diff --git a/libavcodec/snow.c b/libavcodec/snow.c index 492dab77b7..db444f67e4 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -1359,15 +1359,11 @@ static void spatial_compose53i_init(dwt_compose_t *cs, DWTELEM *buffer, int heig static void spatial_compose53i_dy_buffered(dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line){ int y= cs->y; - int mirror0 = mirror(y-1, height-1); - int mirror1 = mirror(y , height-1); - int mirror2 = mirror(y+1, height-1); - int mirror3 = mirror(y+2, height-1); DWTELEM *b0= cs->b0; DWTELEM *b1= cs->b1; - DWTELEM *b2= slice_buffer_get_line(sb, mirror2 * stride_line); - DWTELEM *b3= slice_buffer_get_line(sb, mirror3 * stride_line); + DWTELEM *b2= slice_buffer_get_line(sb, mirror(y+1, height-1) * stride_line); + DWTELEM *b3= slice_buffer_get_line(sb, mirror(y+2, height-1) * stride_line); {START_TIMER if(y+1<(unsigned)height) vertical_compose53iL0(b1, b2, b3, width); @@ -1511,18 +1507,12 @@ static void spatial_compose97i_init(dwt_compose_t *cs, DWTELEM *buffer, int heig static void spatial_compose97i_dy_buffered(dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line){ int y = cs->y; - int mirror0 = mirror(y - 1, height - 1); - int mirror1 = mirror(y + 0, height - 1); - int mirror2 = mirror(y + 1, height - 1); - int mirror3 = mirror(y + 2, height - 1); - int mirror4 = mirror(y + 3, height - 1); - int mirror5 = mirror(y + 4, height - 1); DWTELEM *b0= cs->b0; DWTELEM *b1= cs->b1; DWTELEM *b2= cs->b2; DWTELEM *b3= cs->b3; - DWTELEM *b4= slice_buffer_get_line(sb, mirror4 * stride_line); - DWTELEM *b5= slice_buffer_get_line(sb, mirror5 * stride_line); + DWTELEM *b4= slice_buffer_get_line(sb, mirror(y + 3, height - 1) * stride_line); + DWTELEM *b5= slice_buffer_get_line(sb, mirror(y + 4, height - 1) * stride_line); {START_TIMER if(y>0 && y+4400 && mirror0 <= mirror2){ +if(width>400 && y+0<(unsigned)height){ STOP_TIMER("horizontal_compose97i")}} cs->b0=b2; @@ -1558,14 +1548,6 @@ static void spatial_compose97i_dy(dwt_compose_t *cs, DWTELEM *buffer, int width, DWTELEM *b4= buffer + mirror(y+3, height-1)*stride; DWTELEM *b5= buffer + mirror(y+4, height-1)*stride; - if(stride == width && y+4 < height && 0){ - int x; - for(x=0; xavctx->debug&2048){ int end_y; int our_mb_start = mb_y; int our_mb_end = (mb_y + 1); - start_y = (mb_y ? ((block_w * our_mb_start) >> (s->spatial_decomposition_count - level)) + s->spatial_decomposition_count - level + 2: 0); - end_y = (((block_w * our_mb_end) >> (s->spatial_decomposition_count - level)) + s->spatial_decomposition_count - level + 2); + const int extra= 3; + start_y = (mb_y ? ((block_w * our_mb_start) >> (s->spatial_decomposition_count - level)) + s->spatial_decomposition_count - level + extra: 0); + end_y = (((block_w * our_mb_end) >> (s->spatial_decomposition_count - level)) + s->spatial_decomposition_count - level + extra); if (!(s->keyframe || s->avctx->debug&512)){ start_y = FFMAX(0, start_y - (block_w >> (1+s->spatial_decomposition_count - level))); end_y = FFMAX(0, end_y - (block_w >> (1+s->spatial_decomposition_count - level)));