static inline void x8_select_ac_table(IntraX8Context *const w, int mode)
{
- MpegEncContext *const s = w->s;
int table_index;
- assert(mode < 4);
+ av_assert2(mode < 4);
if (w->j_ac_vlc[mode])
return;
- table_index = get_bits(&s->gb, 3);
+ table_index = get_bits(w->gb, 3);
// 2 modes use same tables
w->j_ac_vlc[mode] = &j_ac_vlc[w->quant < 13][mode >> 1][table_index];
-
- assert(w->j_ac_vlc[mode]);
+ av_assert2(w->j_ac_vlc[mode]);
}
static inline int x8_get_orient_vlc(IntraX8Context *w)
{
- MpegEncContext *const s = w->s;
-
if (!w->j_orient_vlc) {
- int table_index = get_bits(&s->gb, 1 + (w->quant < 13));
+ int table_index = get_bits(w->gb, 1 + (w->quant < 13));
w->j_orient_vlc = &j_orient_vlc[w->quant < 13][table_index];
}
- assert(w->j_orient_vlc);
- assert(w->j_orient_vlc->table);
- return get_vlc2(&s->gb, w->j_orient_vlc->table, OR_VLC_BITS, OR_VLC_MTD);
+ return get_vlc2(w->gb, w->j_orient_vlc->table, OR_VLC_BITS, OR_VLC_MTD);
}
#define extra_bits(eb) (eb) // 3 bits
static int x8_get_dc_rlf(IntraX8Context *const w, const int mode,
int *const level, int *const final)
{
- MpegEncContext *const s = w->s;
int i, e, c;
- assert(mode < 3);
+ av_assert2(mode < 3);
if (!w->j_dc_vlc[mode]) {
- int table_index = get_bits(&s->gb, 3);
+ int table_index = get_bits(w->gb, 3);
// 4 modes, same table
w->j_dc_vlc[mode] = &j_dc_vlc[w->quant < 13][table_index];
}
- assert(w->j_dc_vlc);
- assert(w->j_dc_vlc[mode]->table);
- i = get_vlc2(&s->gb, w->j_dc_vlc[mode]->table, DC_VLC_BITS, DC_VLC_MTD);
+ i = get_vlc2(w->gb, w->j_dc_vlc[mode]->table, DC_VLC_BITS, DC_VLC_MTD);
/* (i >= 17) { i -= 17; final =1; } */
c = i > 16;
{
MpegEncContext *const s = w->s;
int mb_xy;
- w->use_quant_matrix = get_bits1(&s->gb);
- assert(s);
+ w->gb = gb;
w->dquant = dquant;
w->quant = dquant >> 1;
w->qsum = quant_offset;
* The parent codec must call ff_mpv_frame_start() before calling this function.
* The parent codec must call ff_mpv_frame_end() after calling this function.
* This function does not use ff_mpv_decode_mb().
+ * lowres decoding is theoretically impossible.
* @param w pointer to IntraX8Context
* @param pict the output Picture containing an AVFrame
+ * @param gb open bitstream reader
* @param dquant doubled quantizer, it would be odd in case of VC-1 halfpq==1.
* @param quant_offset offset away from zero
* @param loopfilter enable filter after decoding a block