[FFmpeg-devel] [PATCH v9 03/13] vvcdec: add cabac decoder

Nuo Mi nuomi2021 at gmail.com
Tue Jan 2 15:21:44 EET 2024


On Mon, Jan 1, 2024 at 11:13 PM Lynne <dev at lynne.ee> wrote:

>
>
>
> Jan 1, 2024, 15:14 by nuomi2021 at gmail.com:
>
> > +
> > +//fixme
> > +static void vvc_refill2(CABACContext* c) {
> >
>
> Fix what?
> Also, wrong coding style.
>
The function is a copy of refill2 in cabac_functions.h, including the style.
The refill2 is protected by get_cabac_inline.
On x86, get_cabac_inline is only defined when HAVE_7REGS &&
!BROKEN_COMPILER is true.
It can be challenging to figure out how to get refill2 defined in this
context.
Let us use https://github.com/ffvvc/FFmpeg/issues/178 to track this


>
> > +    int i;
> > +    unsigned x;
> > +#if !HAVE_FAST_CLZ
> > +    x = c->low ^ (c->low - 1);
> > +    i = 7 - ff_h264_norm_shift[x >> (CABAC_BITS - 1)];
> > +#else
> > +    i = ff_ctz(c->low) - CABAC_BITS;
> > +#endif
> > +
> > +    x = -CABAC_MASK;
> > +
> > +#if CABAC_BITS == 16
> > +    x += (c->bytestream[0] << 9) + (c->bytestream[1] << 1);
> > +#else
> > +    x += c->bytestream[0] << 1;
> > +#endif
> >
>
> CABAC_BITS?
>
>


More information about the ffmpeg-devel mailing list