[Ffmpeg-devel] Re: A Bug in libavcodec\h264.c ?

Michael Niedermayer michaelni
Thu May 12 10:57:19 CEST 2005


Hi

On Monday 09 May 2005 07:37, Chengji Zhao wrote:
> Hi, Michael Niedermayer and all,
>
> I think I found one typing mistake/ bug in function fill_caches(),
>
> if(IS_INTER(left_type[0])){
>                 const int b_xy= h->mb2b_xy[left_xy[0]] + 3;
>                 const int b8_xy= h->mb2b8_xy[left_xy[0]] + 1;
>                 *(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 0*8]=
> *(uint32_t*)s->current_picture.motion_val[list][b_xy +
> h->b_stride*left_block[0]];
>                 *(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 1*8]=
> *(uint32_t*)s->current_picture.motion_val[list][b_xy +
> h->b_stride*left_block[1]];
>                 h->ref_cache[list][scan8[0] - 1 + 0*8]=
>                 h->ref_cache[list][scan8[0] - 1 + 1*8]=
> s->current_picture.ref_index[list][b8_xy +
> h->b8_stride*(left_block[0]>>1)]; }else{
>                 *(uint32_t*)h->mv_cache [list][scan8[0] - 1 + 0*8]=
>                 *(uint32_t*)h->mv_cache [list][scan8[0] - 1 + 1*8]= 0;
>                 h->ref_cache[list][scan8[0] - 1 + 0*8]=
>                 h->ref_cache[list][scan8[0] - 1 + 1*8]= left_type[0] ?
> LIST_NOT_USED : PART_NOT_AVAILABLE;
>             }
>
>             if(IS_INTER(left_type[1])){
>                 const int b_xy= h->mb2b_xy[left_xy[1]] + 3;
>                 const int b8_xy= h->mb2b8_xy[left_xy[1]] + 1;
>                 *(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 2*8]=
> *(uint32_t*)s->current_picture.motion_val[list][b_xy +
> h->b_stride*left_block[2]];
>                 *(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 3*8]=
> *(uint32_t*)s->current_picture.motion_val[list][b_xy +
> h->b_stride*left_block[3]];
>                 h->ref_cache[list][scan8[0] - 1 + 2*8]=
>                 h->ref_cache[list][scan8[0] - 1 + 3*8]=
> s->current_picture.ref_index[list][b8_xy +
> h->b8_stride*(left_block[2]>>1)]; }else{
>                 *(uint32_t*)h->mv_cache [list][scan8[0] - 1 + 2*8]=
>                 *(uint32_t*)h->mv_cache [list][scan8[0] - 1 + 3*8]= 0;
>                 h->ref_cache[list][scan8[0] - 1 + 2*8]=
>                 h->ref_cache[list][scan8[0] - 1 + 3*8]= left_type[0] ?
> LIST_NOT_USED : PART_NOT_AVAILABLE;
>             }
>
> I think the last line should be changed to
> h->ref_cache[list][scan8[0] - 1 + 3*8]= left_type[1] ? LIST_NOT_USED :
> PART_NOT_AVAILABLE;
> Am I correct?

i think either is correct, anyway i added an assert() so we can see if iam 
right

[...]
-- 
Michael





More information about the ffmpeg-devel mailing list