Go to the documentation of this file.
28 for (
int k = 0; k <= 5; k++) {
31 unsigned int first_bit =
code & (1 << code_len - 1);
39 unsigned int second_bit =
code & (1 << code_len - 2);
45 unsigned int last_bits = first_set - 1 + k;
49 ent->
consume = 2 + first_set + last_bits;
51 (((1 << first_set - 1) - 1) << k) +
52 ((
code >>
bits_left - first_set - last_bits) & (1 << last_bits) - 1));
73 unsigned int next_bits;
77 ent = &lut->
lut[k_param][next_bits];
80 unsigned int leading_zeroes;
85 leading_zeroes = 15 -
av_log2(next_bits);
89 return (2 << k_param) +
90 ((1 << leading_zeroes) - 1) * (1 << k_param) +
91 get_bits(gbc, leading_zeroes + k_param);
113 int abs_dc_coeff_diff;
114 int sign_dc_coeff_diff;
120 if (abs_dc_coeff_diff > 0)
123 sign_dc_coeff_diff = 0;
125 if (sign_dc_coeff_diff)
126 dc_coeff =
state->prev_dc - abs_dc_coeff_diff;
128 dc_coeff =
state->prev_dc + abs_dc_coeff_diff;
133 "Out-of-range DC coefficient value: %d "
134 "(from prev_dc %d abs_dc_coeff_diff %d sign_dc_coeff_diff %d)\n",
135 dc_coeff,
state->prev_dc, abs_dc_coeff_diff, sign_dc_coeff_diff);
141 state->prev_dc = dc_coeff;
142 state->prev_dc_diff = abs_dc_coeff_diff;
149 int prev_level =
state->prev_1st_ac_level;
155 k_param =
av_clip(prev_run >> 2, 0, 2);
160 "Out-of-range zero-run value: %d (at scan pos %d)\n",
161 coeff_zero_run, scan_pos);
165 for (
int i = 0;
i < coeff_zero_run;
i++) {
169 prev_run = coeff_zero_run;
172 int abs_ac_coeff_minus1;
176 k_param =
av_clip(prev_level >> 2, 0, 4);
181 level = -abs_ac_coeff_minus1 - 1;
183 level = abs_ac_coeff_minus1 + 1;
187 prev_level = abs_ac_coeff_minus1 + 1;
189 state->prev_1st_ac_level = prev_level;
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
APVVLCLUTEntry lut[6][APV_VLC_LUT_SIZE]
static int remaining_bits(WmallDecodeCtx *s, GetBitContext *gb)
Calculate remaining input buffer length.
static av_always_inline unsigned int apv_read_vlc(GetBitContext *gbc, int k_param, const APVVLCLUT *lut)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int ff_apv_read_vlc(GetBitContext *gbc, int k_param, const APVVLCLUT *lut)
Read a single APV VLC code.
void ff_apv_entropy_build_decode_lut(APVVLCLUT *decode_lut)
Build the decoder VLC look-up table.
static unsigned int get_bits1(GetBitContext *s)
int ff_apv_entropy_decode_block(int16_t *coeff, GetBitContext *gbc, APVEntropyState *state)
Entropy decode a single 8x8 block to coefficients.
#define i(width, name, range_min, range_max)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
const uint8_t ff_zigzag_direct[64]
static const double coeff[2][5]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.