static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)

{

    unsigned int rice_order, exp_order, switch_bits, switch_val;

    int exponent;



    /* number of prefix bits to switch between Rice and expGolomb */

    switch_bits = (codebook & 3) + 1;

    rice_order  =  codebook >> 5;       /* rice code order */

    exp_order   = (codebook >> 2) & 7;  /* exp golomb code order */



    switch_val  = switch_bits << rice_order;



    if (val >= switch_val) {

        val -= switch_val - (1 << exp_order);

        exponent = av_log2(val);



        put_bits(pb, exponent - exp_order + switch_bits, 0);

        put_bits(pb, 1, 1);

        put_bits(pb, exponent, val);

    } else {

        exponent = val >> rice_order;



        if (exponent)

            put_bits(pb, exponent, 0);

        put_bits(pb, 1, 1);

        if (rice_order)

            put_sbits(pb, rice_order, val);

    }

}

static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)

{

    unsigned int rice_order, exp_order, switch_bits, switch_val;

    int exponent;



    

    switch_bits = (codebook & 3) + 1;

    rice_order  =  codebook >> 5;       

    exp_order   = (codebook >> 2) & 7;  



    switch_val  = switch_bits << rice_order;



    if (val >= switch_val) {

        val -= switch_val - (1 << exp_order);

        exponent = av_log2(val);



        put_bits(pb, exponent - exp_order + switch_bits, 0);

        put_bits(pb, 1, 1);

        put_bits(pb, exponent, val);

    } else {

        exponent = val >> rice_order;



        if (exponent)

            put_bits(pb, exponent, 0);

        put_bits(pb, 1, 1);

        if (rice_order)

            put_sbits(pb, rice_order, val);

    }

}

        put_bits(pb, 1, 1);         put_bits(pb, exponent, val);
static inline void FUNC_0(PutBitContext *VAR_0, unsigned VAR_1, int VAR_2)

{

    unsigned int VAR_3, VAR_4, VAR_5, VAR_6;

    int VAR_7;



    

    VAR_5 = (VAR_1 & 3) + 1;

    VAR_3  =  VAR_1 >> 5;       

    VAR_4   = (VAR_1 >> 2) & 7;  



    VAR_6  = VAR_5 << VAR_3;



    if (VAR_2 >= VAR_6) {

        VAR_2 -= VAR_6 - (1 << VAR_4);

        VAR_7 = av_log2(VAR_2);



        put_bits(VAR_0, VAR_7 - VAR_4 + VAR_5, 0);

        put_bits(VAR_0, 1, 1);

        put_bits(VAR_0, VAR_7, VAR_2);

    } else {

        VAR_7 = VAR_2 >> VAR_3;



        if (VAR_7)

            put_bits(VAR_0, VAR_7, 0);

        put_bits(VAR_0, 1, 1);

        if (VAR_3)

            put_sbits(VAR_0, VAR_3, VAR_2);

    }

}

static inline void FUNC_0(PutBitContext *VAR_0, unsigned VAR_1, int VAR_2)
{ unsigned int VAR_3, VAR_4, VAR_5, VAR_6; int VAR_7; VAR_5 = (VAR_1 & 3) + 1; VAR_3  =  VAR_1 >> 5; VAR_4   = (VAR_1 >> 2) & 7; VAR_6  = VAR_5 << VAR_3; if (VAR_2 >= VAR_6) { VAR_2 -= VAR_6 - (1 << VAR_4); VAR_7 = av_log2(VAR_2); put_bits(VAR_0, VAR_7 - VAR_4 + VAR_5, 0); put_bits(VAR_0, 1, 1); put_bits(VAR_0, VAR_7, VAR_2); } else { VAR_7 = VAR_2 >> VAR_3; if (VAR_7)
put_bits(VAR_0, VAR_7, 0); put_bits(VAR_0, 1, 1); if (VAR_3)
put_sbits(VAR_0, VAR_3, VAR_2); } }