[FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2018-08-23 Thread Paul B Mahol
Signed-off-by: Paul B Mahol --- libavcodec/get_bits.h | 218 +- libavcodec/golomb.h | 151 + 2 files changed, 367 insertions(+), 2 deletions(-) diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2018-04-03 Thread Michael Niedermayer
On Tue, Apr 03, 2018 at 01:38:12PM +0200, Paul B Mahol wrote: [...] > > -static inline void skip_bits_long(GetBitContext *s, int n) > +static inline void refill_32(GetBitContext *s) > { > -#if UNCHECKED_BITSTREAM_READER > -s->index += n; > +#ifdef CACHED_BITSTREAM_READER > +#if

[FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2018-04-03 Thread Paul B Mahol
Signed-off-by: Paul B Mahol --- libavcodec/get_bits.h | 268 +- libavcodec/golomb.h | 151 2 files changed, 393 insertions(+), 26 deletions(-) diff --git a/libavcodec/get_bits.h

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-14 Thread foo86
On Fri, Jul 14, 2017 at 05:12:25PM +0200, Hendrik Leppkes wrote: > On Fri, Jul 14, 2017 at 4:08 PM, foo86 wrote: > > On Thu, Jul 13, 2017 at 12:27:03PM +0200, Paul B Mahol wrote: > >> +static inline unsigned int get_bits(GetBitContext *s, int n) > >> { > >> +#ifdef

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-14 Thread Hendrik Leppkes
On Fri, Jul 14, 2017 at 4:08 PM, foo86 wrote: > On Thu, Jul 13, 2017 at 12:27:03PM +0200, Paul B Mahol wrote: >> +static inline unsigned int get_bits(GetBitContext *s, int n) >> { >> +#ifdef CACHED_BITSTREAM_READER >> +register int tmp = 0; >> +#ifdef BITSTREAM_READER_LE

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-14 Thread foo86
On Thu, Jul 13, 2017 at 12:27:03PM +0200, Paul B Mahol wrote: > +static inline unsigned int get_bits(GetBitContext *s, int n) > { > +#ifdef CACHED_BITSTREAM_READER > +register int tmp = 0; > +#ifdef BITSTREAM_READER_LE > +uint64_t left = 0; > +#endif > + > +av_assert2(n>0 && n<=32); >

[FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-13 Thread Paul B Mahol
Signed-off-by: Paul B Mahol --- libavcodec/get_bits.h | 263 +- libavcodec/golomb.h | 151 + 2 files changed, 388 insertions(+), 26 deletions(-) diff --git a/libavcodec/get_bits.h

[FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-11 Thread Paul B Mahol
Signed-off-by: Paul B Mahol --- libavcodec/get_bits.h | 263 +- 1 file changed, 237 insertions(+), 26 deletions(-) diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index c530015..dbacdda 100644 ---

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-08 Thread Paul B Mahol
On 7/8/17, foo86 wrote: > On Sat, Jul 08, 2017 at 08:07:49PM +0200, Hendrik Leppkes wrote: >> On Sat, Jul 8, 2017 at 7:09 PM, foo86 wrote: >> >> +static inline void skip_bits_long(GetBitContext *s, int n) >> >> +{ >> >> +#ifdef CACHED_BITSTREAM_READER >>

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-08 Thread foo86
On Sat, Jul 08, 2017 at 08:07:49PM +0200, Hendrik Leppkes wrote: > On Sat, Jul 8, 2017 at 7:09 PM, foo86 wrote: > >> +static inline void skip_bits_long(GetBitContext *s, int n) > >> +{ > >> +#ifdef CACHED_BITSTREAM_READER > >> +skip_bits(s, n); > >> +#else > >> +#if

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-08 Thread foo86
On Sat, Jul 08, 2017 at 07:25:52PM +0200, Paul B Mahol wrote: > On 7/8/17, foo86 wrote: > > On Sat, Jul 08, 2017 at 11:12:06AM +0200, Paul B Mahol wrote: > >> [...] > > > >> static inline void skip_bits(GetBitContext *s, int n) > >> { > >> +#ifdef CACHED_BITSTREAM_READER >

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-08 Thread Hendrik Leppkes
On Sat, Jul 8, 2017 at 7:23 PM, Rostislav Pehlivanov wrote: > On 8 July 2017 at 10:12, Paul B Mahol wrote: > >> Signed-off-by: Paul B Mahol >> --- >> libavcodec/get_bits.h | 261 ++ >> +++- >>

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-08 Thread Hendrik Leppkes
On Sat, Jul 8, 2017 at 7:09 PM, foo86 wrote: > On Sat, Jul 08, 2017 at 11:12:06AM +0200, Paul B Mahol wrote: >> [...] > >> static inline void skip_bits(GetBitContext *s, int n) >> { >> +#ifdef CACHED_BITSTREAM_READER >> +if (n <= s->bits_left) >> +

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-08 Thread Rostislav Pehlivanov
On 8 July 2017 at 10:12, Paul B Mahol wrote: > Signed-off-by: Paul B Mahol > --- > libavcodec/get_bits.h | 261 ++ > +++- > 1 file changed, 235 insertions(+), 26 deletions(-) > > > I still say it should be enabled

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-08 Thread Paul B Mahol
On 7/8/17, foo86 wrote: > On Sat, Jul 08, 2017 at 11:12:06AM +0200, Paul B Mahol wrote: >> [...] > >> static inline void skip_bits(GetBitContext *s, int n) >> { >> +#ifdef CACHED_BITSTREAM_READER >> +if (n <= s->bits_left) >> +skip_remaining(s, n); >> +else {

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-08 Thread foo86
On Sat, Jul 08, 2017 at 11:12:06AM +0200, Paul B Mahol wrote: > [...] > static inline void skip_bits(GetBitContext *s, int n) > { > +#ifdef CACHED_BITSTREAM_READER > +if (n <= s->bits_left) > +skip_remaining(s, n); > +else { > +n -= s->bits_left; > +

[FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-08 Thread Paul B Mahol
Signed-off-by: Paul B Mahol --- libavcodec/get_bits.h | 261 +- 1 file changed, 235 insertions(+), 26 deletions(-) diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index c530015..f404b80 100644 ---

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-07 Thread Michael Niedermayer
On Fri, Jul 07, 2017 at 08:48:46PM +0200, Paul B Mahol wrote: > Signed-off-by: Paul B Mahol > --- > libavcodec/get_bits.h | 205 > +++--- > 1 file changed, 196 insertions(+), 9 deletions(-) > > diff --git a/libavcodec/get_bits.h

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-07 Thread Ronald S. Bultje
Hi, On Fri, Jul 7, 2017 at 4:43 PM, Paul B Mahol wrote: > On 7/7/17, Ronald S. Bultje wrote: > > (I'm assuming the low-level interface no longer works with the cached > > reader, so can we prevent users from accessing these macros unless > > cached=1?) > >

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-07 Thread Paul B Mahol
On 7/7/17, Ronald S. Bultje wrote: > Hi, > > On Fri, Jul 7, 2017 at 2:48 PM, Paul B Mahol wrote: > >> typedef struct GetBitContext { >> const uint8_t *buffer, *buffer_end; >> +#ifdef CACHED_BITSTREAM_READER >> +uint64_t cache; >> +unsigned

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-07 Thread Ronald S. Bultje
Hi, On Fri, Jul 7, 2017 at 2:48 PM, Paul B Mahol wrote: > typedef struct GetBitContext { > const uint8_t *buffer, *buffer_end; > +#ifdef CACHED_BITSTREAM_READER > +uint64_t cache; > +unsigned bits_left; > +#endif > Can you post some stats (from relevant systems,

[FFmpeg-devel] [PATCH 1/3] avcodec/get_bits: add cached bitstream reader

2017-07-07 Thread Paul B Mahol
Signed-off-by: Paul B Mahol --- libavcodec/get_bits.h | 205 +++--- 1 file changed, 196 insertions(+), 9 deletions(-) diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index c530015..8a9021a 100644 ---