[Ffmpeg-devel] H.264 encoder

Michael Niedermayer michaelni
Tue Oct 10 21:36:20 CEST 2006


Hi

On Tue, Oct 10, 2006 at 05:25:07PM +0200, Panagiotis Issaris wrote:
> Hi,
> 
> On Wed, Oct 04, 2006 at 01:11:07PM +0200, Michael Niedermayer wrote:
> > > > [...]
> > > >
> > > >> +static inline int h264cavlc_get_lookup_table(int na, int nb)
> > > >> +{
> > > >> +    int nc = 0;
> > > >> +    int8_t lookup_table[8] = {0, 0, 1, 1, 2, 2, 2, 2};
> > > >> +
> > > >> +    if (na >= 0 && nb >= 0)
> > > >> +    {
> > > >> +        nc = na+nb+1;
> > > >> +        nc >>= 1;
> > > >> +    }
> > > >> +    else
> > > >> +    {
> > > >> +        if (na >= 0) // nB < 0
> > > >> +            nc = na;
> > > >> +        else if (nb >= 0) // nA < 0
> > > >> +            nc = nb;
> > > >> +    }
> > > >> +
> > > >> +    return (nc < 8) ? lookup_table[nc] : 3;
> > > >> +}
> > > > pred_non_zero_count() could be used for the first part
> > [...]
> pred_non_zero_count() is using non_zero_count_cache, which is getting filled by
> fill_caches() which is dependent on MpegEncContext. This makes it nearly
> impossible to reuse this unless I pull in MpegEncContext in the H264 encoder.
> Would that be a good idea?

probably not -> change pred_non_zero_count() so it takes the top and left
values as arguments instead of H264Context, or change it so a it takes a
pointer to non_zero_count_cache ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list