[Ffmpeg-devel] H.264 MB_Type decoding implementation in FFMPEG
Guy Bonneau
gbonneau
Thu Oct 12 17:04:18 CEST 2006
Indeed,
I missed the state += 2.
Thanks Loren
Guy
> -----Original Message-----
> From: ffmpeg-devel-bounces at mplayerhq.hu [mailto:ffmpeg-devel-
> bounces at mplayerhq.hu] On Behalf Of Loren Merritt
> Sent: Wednesday, October 11, 2006 1:54 PM
> To: FFmpeg development discussions and patches
> Subject: Re: [Ffmpeg-devel] FW: H.264 MB_Type decoding implementation in
> FFMPEG
>
> On Wed, 11 Oct 2006, Guy Bonneau wrote:
>
> > Here is the problem I see in the decoding function
> > decode_cabac_intra_mb_type(...)
> >
> > When an Intra Macroblock I16x16 is detected this code follow:
> >
> > mb_type = 1; /* I16x16 */
> > mb_type += 12 * get_cabac( &h->cabac, &state[1] ); /* cbp_luma != 0
> */
> > if( get_cabac( &h->cabac, &state[2] ) ) /* cbp_chroma */
> > mb_type += 4 + 4 * get_cabac( &h->cabac, &state[2+intra_slice] );
> > mb_type += 2 * get_cabac( &h->cabac, &state[3+intra_slice] );
> > mb_type += 1 * get_cabac( &h->cabac, &state[3+2*intra_slice] );
> >
> > Now according to the ITU-T Rec H.264(03/2005) the second line decodes
> binIdx
> > 2 and the ctxIdxOffset is 3 since we are decoding an Intra MacroBlock in
> an
> > Intra slice. (Table 9-30). According to table 9-30 we are supposing to
> use
> > ctxIdxInc 3 and the following line should use ctxIdxInc 4. Thus I would
> > expect the code to be :
> >
> > mb_type += 12 * get_cabac( &h->cabac, &state[3] ); /* cbp_luma != 0
> */
> > if( get_cabac( &h->cabac, &state[4] ) ) /* cbp_chroma */
> > (...)
> >
> > I missed something ?
>
> uint8_t *state= &h->cabac_state[ctx_base]; // state = context #3
> state += 2; // state = context #5
> mb_type += 12 * get_cabac( &h->cabac, &state[1] ); // decodes context #6
>
> While the standard says it should use ctxIdxOffset=3 and ctxIdxInc=3, for
> a total of context #6.
>
> --Loren Merritt
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
More information about the ffmpeg-devel
mailing list