Lines Matching refs:idct

143 create_mismatch_vert_shader(struct vl_idct *idct)  in create_mismatch_vert_shader()  argument
175 (float)VL_BLOCK_WIDTH / idct->buffer_width, in create_mismatch_vert_shader()
176 (float)VL_BLOCK_HEIGHT / idct->buffer_height); in create_mismatch_vert_shader()
182 … calc_addr(shader, o_addr, ureg_src(t_tex), ureg_src(t_tex), false, false, idct->buffer_width / 4); in create_mismatch_vert_shader()
188 return ureg_create_shader_and_destroy(shader, idct->pipe); in create_mismatch_vert_shader()
192 create_mismatch_frag_shader(struct vl_idct *idct) in create_mismatch_frag_shader() argument
218 increment_addr(shader, m[i], addr, false, false, i, idct->buffer_height); in create_mismatch_frag_shader()
255 return ureg_create_shader_and_destroy(shader, idct->pipe); in create_mismatch_frag_shader()
259 create_stage1_vert_shader(struct vl_idct *idct) in create_stage1_vert_shader() argument
298 (float)VL_BLOCK_WIDTH / idct->buffer_width, in create_stage1_vert_shader()
299 (float)VL_BLOCK_HEIGHT / idct->buffer_height); in create_stage1_vert_shader()
309 …calc_addr(shader, o_l_addr, ureg_src(t_tex), ureg_src(t_start), false, false, idct->buffer_width /… in create_stage1_vert_shader()
317 return ureg_create_shader_and_destroy(shader, idct->pipe); in create_stage1_vert_shader()
321 create_stage1_frag_shader(struct vl_idct *idct) in create_stage1_frag_shader() argument
336 fragment = MALLOC(idct->nr_of_render_targets * sizeof(struct ureg_dst)); in create_stage1_frag_shader()
344 for (i = 0; i < idct->nr_of_render_targets; ++i) in create_stage1_frag_shader()
356 increment_addr(shader, l[i], l_addr, false, false, i - 2, idct->buffer_height); in create_stage1_frag_shader()
366 for (i = 0; i < idct->nr_of_render_targets; ++i) { in create_stage1_frag_shader()
369 …increment_addr(shader, r, r_addr, true, true, i - (signed)idct->nr_of_render_targets / 2, VL_BLOCK… in create_stage1_frag_shader()
391 return ureg_create_shader_and_destroy(shader, idct->pipe); in create_stage1_frag_shader()
395 vl_idct_stage2_vert_shader(struct vl_idct *idct, struct ureg_program *shader, in vl_idct_stage2_vert_shader() argument
417 (float)VL_BLOCK_WIDTH / idct->buffer_width, in vl_idct_stage2_vert_shader()
418 (float)VL_BLOCK_HEIGHT / idct->buffer_height); in vl_idct_stage2_vert_shader()
422 ureg_imm1f(shader, VL_BLOCK_WIDTH / idct->nr_of_render_targets)); in vl_idct_stage2_vert_shader()
426 …calc_addr(shader, o_r_addr, ureg_src(tex), ureg_src(t_start), true, false, idct->buffer_height / 4… in vl_idct_stage2_vert_shader()
433 vl_idct_stage2_frag_shader(struct vl_idct *idct, struct ureg_program *shader, in vl_idct_stage2_frag_shader() argument
465 init_shaders(struct vl_idct *idct) in init_shaders() argument
467 idct->vs_mismatch = create_mismatch_vert_shader(idct); in init_shaders()
468 if (!idct->vs_mismatch) in init_shaders()
471 idct->fs_mismatch = create_mismatch_frag_shader(idct); in init_shaders()
472 if (!idct->fs_mismatch) in init_shaders()
475 idct->vs = create_stage1_vert_shader(idct); in init_shaders()
476 if (!idct->vs) in init_shaders()
479 idct->fs = create_stage1_frag_shader(idct); in init_shaders()
480 if (!idct->fs) in init_shaders()
486 idct->pipe->delete_vs_state(idct->pipe, idct->vs); in init_shaders()
489 idct->pipe->delete_vs_state(idct->pipe, idct->vs_mismatch); in init_shaders()
492 idct->pipe->delete_vs_state(idct->pipe, idct->fs); in init_shaders()
499 cleanup_shaders(struct vl_idct *idct) in cleanup_shaders() argument
501 idct->pipe->delete_vs_state(idct->pipe, idct->vs_mismatch); in cleanup_shaders()
502 idct->pipe->delete_fs_state(idct->pipe, idct->fs_mismatch); in cleanup_shaders()
503 idct->pipe->delete_vs_state(idct->pipe, idct->vs); in cleanup_shaders()
504 idct->pipe->delete_fs_state(idct->pipe, idct->fs); in cleanup_shaders()
508 init_state(struct vl_idct *idct) in init_state() argument
515 assert(idct); in init_state()
521 idct->rs_state = idct->pipe->create_rasterizer_state(idct->pipe, &rs_state); in init_state()
522 if (!idct->rs_state) in init_state()
540 idct->blend = idct->pipe->create_blend_state(idct->pipe, &blend); in init_state()
541 if (!idct->blend) in init_state()
555 idct->samplers[i] = idct->pipe->create_sampler_state(idct->pipe, &sampler); in init_state()
556 if (!idct->samplers[i]) in init_state()
564 if (idct->samplers[i]) in init_state()
565 idct->pipe->delete_sampler_state(idct->pipe, idct->samplers[i]); in init_state()
567 idct->pipe->delete_rasterizer_state(idct->pipe, idct->rs_state); in init_state()
570 idct->pipe->delete_blend_state(idct->pipe, idct->blend); in init_state()
577 cleanup_state(struct vl_idct *idct) in cleanup_state() argument
582 idct->pipe->delete_sampler_state(idct->pipe, idct->samplers[i]); in cleanup_state()
584 idct->pipe->delete_rasterizer_state(idct->pipe, idct->rs_state); in cleanup_state()
585 idct->pipe->delete_blend_state(idct->pipe, idct->blend); in cleanup_state()
589 init_source(struct vl_idct *idct, struct vl_idct_buffer *buffer) in init_source() argument
594 assert(idct && buffer); in init_source()
607 buffer->fb_state_mismatch.cbufs[0] = idct->pipe->create_surface(idct->pipe, tex, &surf_templ); in init_source()
628 init_intermediate(struct vl_idct *idct, struct vl_idct_buffer *buffer) in init_intermediate() argument
634 assert(idct && buffer); in init_intermediate()
640 buffer->fb_state.nr_cbufs = idct->nr_of_render_targets; in init_intermediate()
641 for(i = 0; i < idct->nr_of_render_targets; ++i) { in init_intermediate()
647 buffer->fb_state.cbufs[i] = idct->pipe->create_surface( in init_intermediate()
648 idct->pipe, tex, &surf_templ); in init_intermediate()
662 for(i = 0; i < idct->nr_of_render_targets; ++i) in init_intermediate()
758 bool vl_idct_init(struct vl_idct *idct, struct pipe_context *pipe, in vl_idct_init() argument
764 assert(idct && pipe); in vl_idct_init()
767 idct->pipe = pipe; in vl_idct_init()
768 idct->buffer_width = buffer_width; in vl_idct_init()
769 idct->buffer_height = buffer_height; in vl_idct_init()
770 idct->nr_of_render_targets = nr_of_render_targets; in vl_idct_init()
772 pipe_sampler_view_reference(&idct->matrix, matrix); in vl_idct_init()
773 pipe_sampler_view_reference(&idct->transpose, transpose); in vl_idct_init()
775 if(!init_shaders(idct)) in vl_idct_init()
778 if(!init_state(idct)) { in vl_idct_init()
779 cleanup_shaders(idct); in vl_idct_init()
787 vl_idct_cleanup(struct vl_idct *idct) in vl_idct_cleanup() argument
789 cleanup_shaders(idct); in vl_idct_cleanup()
790 cleanup_state(idct); in vl_idct_cleanup()
792 pipe_sampler_view_reference(&idct->matrix, NULL); in vl_idct_cleanup()
793 pipe_sampler_view_reference(&idct->transpose, NULL); in vl_idct_cleanup()
797 vl_idct_init_buffer(struct vl_idct *idct, struct vl_idct_buffer *buffer, in vl_idct_init_buffer() argument
801 assert(buffer && idct); in vl_idct_init_buffer()
806 pipe_sampler_view_reference(&buffer->sampler_views.individual.matrix, idct->matrix); in vl_idct_init_buffer()
808 pipe_sampler_view_reference(&buffer->sampler_views.individual.transpose, idct->transpose); in vl_idct_init_buffer()
811 if (!init_source(idct, buffer)) in vl_idct_init_buffer()
814 if (!init_intermediate(idct, buffer)) in vl_idct_init_buffer()
833 vl_idct_flush(struct vl_idct *idct, struct vl_idct_buffer *buffer, unsigned num_instances) in vl_idct_flush() argument
837 idct->pipe->bind_rasterizer_state(idct->pipe, idct->rs_state); in vl_idct_flush()
838 idct->pipe->bind_blend_state(idct->pipe, idct->blend); in vl_idct_flush()
839 idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers); in vl_idct_flush()
840 idct->pipe->set_fragment_sampler_views(idct->pipe, 2, buffer->sampler_views.stage[0]); in vl_idct_flush()
843 idct->pipe->set_framebuffer_state(idct->pipe, &buffer->fb_state_mismatch); in vl_idct_flush()
844 idct->pipe->set_viewport_state(idct->pipe, &buffer->viewport_mismatch); in vl_idct_flush()
845 idct->pipe->bind_vs_state(idct->pipe, idct->vs_mismatch); in vl_idct_flush()
846 idct->pipe->bind_fs_state(idct->pipe, idct->fs_mismatch); in vl_idct_flush()
847 util_draw_arrays_instanced(idct->pipe, PIPE_PRIM_POINTS, 0, 1, 0, num_instances); in vl_idct_flush()
850 idct->pipe->set_framebuffer_state(idct->pipe, &buffer->fb_state); in vl_idct_flush()
851 idct->pipe->set_viewport_state(idct->pipe, &buffer->viewport); in vl_idct_flush()
852 idct->pipe->bind_vs_state(idct->pipe, idct->vs); in vl_idct_flush()
853 idct->pipe->bind_fs_state(idct->pipe, idct->fs); in vl_idct_flush()
854 util_draw_arrays_instanced(idct->pipe, PIPE_PRIM_QUADS, 0, 4, 0, num_instances); in vl_idct_flush()
858 vl_idct_prepare_stage2(struct vl_idct *idct, struct vl_idct_buffer *buffer) in vl_idct_prepare_stage2() argument
863 idct->pipe->bind_rasterizer_state(idct->pipe, idct->rs_state); in vl_idct_prepare_stage2()
864 idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers); in vl_idct_prepare_stage2()
865 idct->pipe->set_fragment_sampler_views(idct->pipe, 2, buffer->sampler_views.stage[1]); in vl_idct_prepare_stage2()