Revision 33996217
libavcodec/dwt.c | ||
---|---|---|
22 | 22 |
#include "dsputil.h" |
23 | 23 |
#include "dwt.h" |
24 | 24 |
|
25 |
void slice_buffer_init(slice_buffer * buf, int line_count, int max_allocated_lines, int line_width, IDWTELEM * base_buffer) |
|
25 |
void ff_slice_buffer_init(slice_buffer * buf, int line_count, int max_allocated_lines, int line_width, IDWTELEM * base_buffer)
|
|
26 | 26 |
{ |
27 | 27 |
int i; |
28 | 28 |
|
... | ... | |
40 | 40 |
buf->data_stack_top = max_allocated_lines - 1; |
41 | 41 |
} |
42 | 42 |
|
43 |
IDWTELEM * slice_buffer_load_line(slice_buffer * buf, int line) |
|
43 |
IDWTELEM * ff_slice_buffer_load_line(slice_buffer * buf, int line)
|
|
44 | 44 |
{ |
45 | 45 |
IDWTELEM * buffer; |
46 | 46 |
|
... | ... | |
56 | 56 |
return buffer; |
57 | 57 |
} |
58 | 58 |
|
59 |
void slice_buffer_release(slice_buffer * buf, int line) |
|
59 |
void ff_slice_buffer_release(slice_buffer * buf, int line)
|
|
60 | 60 |
{ |
61 | 61 |
IDWTELEM * buffer; |
62 | 62 |
|
... | ... | |
69 | 69 |
buf->line[line] = NULL; |
70 | 70 |
} |
71 | 71 |
|
72 |
void slice_buffer_flush(slice_buffer * buf) |
|
72 |
void ff_slice_buffer_flush(slice_buffer * buf)
|
|
73 | 73 |
{ |
74 | 74 |
int i; |
75 | 75 |
for(i = 0; i < buf->line_count; i++){ |
76 | 76 |
if (buf->line[i]) |
77 |
slice_buffer_release(buf, i); |
|
77 |
ff_slice_buffer_release(buf, i);
|
|
78 | 78 |
} |
79 | 79 |
} |
80 | 80 |
|
81 |
void slice_buffer_destroy(slice_buffer * buf) |
|
81 |
void ff_slice_buffer_destroy(slice_buffer * buf)
|
|
82 | 82 |
{ |
83 | 83 |
int i; |
84 |
slice_buffer_flush(buf); |
|
84 |
ff_slice_buffer_flush(buf);
|
|
85 | 85 |
|
86 | 86 |
for(i = buf->data_count - 1; i >= 0; i--){ |
87 | 87 |
av_freep(&buf->data_stack[i]); |
... | ... | |
817 | 817 |
return w_c(v, pix1, pix2, line_size, 16, h, 0); |
818 | 818 |
} |
819 | 819 |
|
820 |
int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ |
|
820 |
int ff_w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
|
|
821 | 821 |
return w_c(v, pix1, pix2, line_size, 32, h, 1); |
822 | 822 |
} |
823 | 823 |
|
824 |
int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ |
|
824 |
int ff_w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
|
|
825 | 825 |
return w_c(v, pix1, pix2, line_size, 32, h, 0); |
826 | 826 |
} |
827 | 827 |
|
libavcodec/dwt.h | ||
---|---|---|
126 | 126 |
#define W_DS 9 |
127 | 127 |
#endif |
128 | 128 |
|
129 |
#define slice_buffer_get_line(slice_buf, line_num) ((slice_buf)->line[line_num] ? (slice_buf)->line[line_num] : slice_buffer_load_line((slice_buf), (line_num))) |
|
130 |
//#define slice_buffer_get_line(slice_buf, line_num) (slice_buffer_load_line((slice_buf), (line_num))) |
|
129 |
#define slice_buffer_get_line(slice_buf, line_num) ((slice_buf)->line[line_num] ? (slice_buf)->line[line_num] : ff_slice_buffer_load_line((slice_buf), (line_num)))
|
|
130 |
//#define slice_buffer_get_line(slice_buf, line_num) (ff_slice_buffer_load_line((slice_buf), (line_num)))
|
|
131 | 131 |
|
132 |
void slice_buffer_init(slice_buffer * buf, int line_count, int max_allocated_lines, int line_width, IDWTELEM * base_buffer); |
|
133 |
void slice_buffer_release(slice_buffer * buf, int line); |
|
134 |
void slice_buffer_flush(slice_buffer * buf); |
|
135 |
void slice_buffer_destroy(slice_buffer * buf); |
|
136 |
IDWTELEM * slice_buffer_load_line(slice_buffer * buf, int line); |
|
132 |
void ff_slice_buffer_init(slice_buffer * buf, int line_count, int max_allocated_lines, int line_width, IDWTELEM * base_buffer);
|
|
133 |
void ff_slice_buffer_release(slice_buffer * buf, int line);
|
|
134 |
void ff_slice_buffer_flush(slice_buffer * buf);
|
|
135 |
void ff_slice_buffer_destroy(slice_buffer * buf);
|
|
136 |
IDWTELEM * ff_slice_buffer_load_line(slice_buffer * buf, int line);
|
|
137 | 137 |
|
138 | 138 |
void ff_snow_vertical_compose97i(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width); |
139 | 139 |
void ff_snow_horizontal_compose97i(IDWTELEM *b, int width); |
140 | 140 |
void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8); |
141 | 141 |
|
142 |
int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h); |
|
143 |
int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h); |
|
142 |
int ff_w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h);
|
|
143 |
int ff_w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h);
|
|
144 | 144 |
|
145 | 145 |
void ff_spatial_dwt(int *buffer, int width, int height, int stride, int type, int decomposition_count); |
146 | 146 |
|
libavcodec/snow.c | ||
---|---|---|
2081 | 2081 |
common_init_after_header(avctx); |
2082 | 2082 |
|
2083 | 2083 |
// realloc slice buffer for the case that spatial_decomposition_count changed |
2084 |
slice_buffer_destroy(&s->sb); |
|
2085 |
slice_buffer_init(&s->sb, s->plane[0].height, (MB_SIZE >> s->block_max_depth) + s->spatial_decomposition_count * 8 + 1, s->plane[0].width, s->spatial_idwt_buffer); |
|
2084 |
ff_slice_buffer_destroy(&s->sb);
|
|
2085 |
ff_slice_buffer_init(&s->sb, s->plane[0].height, (MB_SIZE >> s->block_max_depth) + s->spatial_decomposition_count * 8 + 1, s->plane[0].width, s->spatial_idwt_buffer);
|
|
2086 | 2086 |
|
2087 | 2087 |
for(plane_index=0; plane_index<3; plane_index++){ |
2088 | 2088 |
Plane *p= &s->plane[plane_index]; |
... | ... | |
2199 | 2199 |
y = FFMIN(p->height, slice_starty); |
2200 | 2200 |
end_y = FFMIN(p->height, slice_h); |
2201 | 2201 |
while(y < end_y) |
2202 |
slice_buffer_release(&s->sb, y++); |
|
2202 |
ff_slice_buffer_release(&s->sb, y++);
|
|
2203 | 2203 |
} |
2204 | 2204 |
|
2205 |
slice_buffer_flush(&s->sb); |
|
2205 |
ff_slice_buffer_flush(&s->sb);
|
|
2206 | 2206 |
} |
2207 | 2207 |
|
2208 | 2208 |
} |
... | ... | |
2228 | 2228 |
{ |
2229 | 2229 |
SnowContext *s = avctx->priv_data; |
2230 | 2230 |
|
2231 |
slice_buffer_destroy(&s->sb); |
|
2231 |
ff_slice_buffer_destroy(&s->sb);
|
|
2232 | 2232 |
|
2233 | 2233 |
common_end(s); |
2234 | 2234 |
|
... | ... | |
2829 | 2829 |
* to improve the score of the whole frame, thus iterative motion |
2830 | 2830 |
* estimation does not always converge. */ |
2831 | 2831 |
if(s->avctx->me_cmp == FF_CMP_W97) |
2832 |
distortion = w97_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); |
|
2832 |
distortion = ff_w97_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32);
|
|
2833 | 2833 |
else if(s->avctx->me_cmp == FF_CMP_W53) |
2834 |
distortion = w53_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); |
|
2834 |
distortion = ff_w53_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32);
|
|
2835 | 2835 |
else{ |
2836 | 2836 |
distortion = 0; |
2837 | 2837 |
for(i=0; i<4; i++){ |
Also available in: Unified diff