[FFmpeg-devel] [PATCH] dirac: make initialization of arithmetic coder tables threadsafe.
Ronald S. Bultje
rsbultje at gmail.com
Tue Mar 28 18:24:19 EEST 2017
Hi,
On Mon, Mar 27, 2017 at 11:24 AM, Ronald S. Bultje <rsbultje at gmail.com>
wrote:
> Hi,
>
> On Mon, Mar 27, 2017 at 11:10 AM, Michael Niedermayer <
> michael at niedermayer.cc> wrote:
>
>> On Mon, Mar 27, 2017 at 10:09:05AM -0400, Ronald S. Bultje wrote:
>> > ---
>> > libavcodec/dirac_arith.c | 17 +++++++++++------
>> > libavcodec/dirac_arith.h | 1 +
>> > libavcodec/diracdec.c | 9 ++++++++-
>> > 3 files changed, 20 insertions(+), 7 deletions(-)
>> >
>> > diff --git a/libavcodec/dirac_arith.c b/libavcodec/dirac_arith.c
>> > index bf91392..49c0909 100644
>> > --- a/libavcodec/dirac_arith.c
>> > +++ b/libavcodec/dirac_arith.c
>> > @@ -83,9 +83,19 @@ const uint8_t ff_dirac_next_ctx[DIRAC_CTX_COUNT] = {
>> >
>> > int16_t ff_dirac_prob_branchless[256][2];
>> >
>> > -void ff_dirac_init_arith_decoder(DiracArith *c, GetBitContext *gb,
>> int length)
>> > +av_cold void ff_dirac_init_arith_tables(void)
>> > {
>> > int i;
>> > +
>> > + for (i = 0; i < 256; i++) {
>> > + ff_dirac_prob_branchless[i][0] = ff_dirac_prob[255-i];
>> > + ff_dirac_prob_branchless[i][1] = -ff_dirac_prob[i];
>> > + }
>> > +}
>> > +
>> > +void ff_dirac_init_arith_decoder(DiracArith *c, GetBitContext *gb,
>> int length)
>> > +{
>> > + int i, ret;
>>
>> ret seems unused
>
>
> Will remove locally.
>
Removed, and pushed.
Ronald
More information about the ffmpeg-devel
mailing list