33 const int16_t (*
quant_table)[256] =
f->quant_tables[p->quant_table_index];
37 int run_index = sc->run_index;
40 for (x = 0; x <
w; x++)
48 if (sc->slice_coding_mode == 1) {
50 for (x = 0; x <
w; x++) {
61 for (x = 0; x <
w; x++) {
62 int diff, context, sign;
82 if (context == 0 && run_mode == 0)
86 if (run_count == 0 && run_mode == 1) {
89 if (x + run_count <=
w)
102 while (run_count > 1 &&
w-x > 1) {
108 while (run_count > 1 &&
w-x > 1) {
127 ff_dlog(
f->avctx,
"count:%d index:%d, mode:%d, x:%d pos:%d\n",
136 sc->run_index = run_index;
146 int lbd =
f->avctx->bits_per_raw_sample <= 8;
148 int transparency =
f->transparency;
155 for (
int p=0; p<3+
f->transparency; p++) {
156 if (
f->avctx->bits_per_raw_sample == 32) {
157 av_assert0(sc->fltmap32_size[p] >= (
mask[p] + 1LL) *
sizeof(*sc->fltmap32[p]));
159 av_assert0(sc->fltmap_size[p] >= (
mask[p] + 1LL) *
sizeof(*sc->fltmap[p]));
162 if (sc->slice_coding_mode == 1)
165 for (x = 0; x < 4; x++) {
166 sample[x][0] =
RENAME(sc->sample_buffer) + x * 2 * (
w + 6) + 3;
167 sample[x][1] =
RENAME(sc->sample_buffer) + (x * 2 + 1) * (
w + 6) + 3;
172 memset(
RENAME(sc->sample_buffer), 0, 8 * (
w + 6) *
sizeof(*
RENAME(sc->sample_buffer)));
174 for (y = 0; y <
h; y++) {
175 for (p = 0; p < 3 + transparency; p++) {
185 ret =
RENAME(decode_line)(
f, sc, gb,
w,
sample[p], (p + 1)/2, 9, ac);
191 for (x = 0; x <
w; x++) {
197 if (sc->slice_coding_mode != 1) {
200 g -= (
b * sc->slice_rct_by_coef +
r * sc->slice_rct_ry_coef) >> 2;
205 if (
f->avctx->bits_per_raw_sample == 32) {
206 g = sc->fltmap32[0][
g &
mask[0]];
207 b = sc->fltmap32[1][
b &
mask[1]];
208 r = sc->fltmap32[2][
r &
mask[2]];
210 a = sc->fltmap32[3][
a &
mask[3]];
212 g = sc->fltmap[0][
g &
mask[0]];
213 b = sc->fltmap[1][
b &
mask[1]];
214 r = sc->fltmap[2][
r &
mask[2]];
216 a = sc->fltmap[3][
a &
mask[3]];
221 *((uint32_t*)(
src[0] + x*4 +
stride[0]*y)) =
b + ((unsigned)
g<<8) + ((
unsigned)
r<<16) + ((unsigned)
a<<24);
222 }
else if (
f->avctx->bits_per_raw_sample == 32) {
223 *((uint32_t*)(
src[0] + x*4 +
stride[0]*y)) =
g;
224 *((uint32_t*)(
src[1] + x*4 +
stride[1]*y)) =
b;
225 *((uint32_t*)(
src[2] + x*4 +
stride[2]*y)) =
r;
227 *((uint32_t*)(
src[3] + x*4 +
stride[3]*y)) =
a;
228 }
else if (
sizeof(
TYPE) == 4 || transparency) {
229 *((uint16_t*)(
src[0] + x*2 +
stride[0]*y)) =
g;
230 *((uint16_t*)(
src[1] + x*2 +
stride[1]*y)) =
b;
231 *((uint16_t*)(
src[2] + x*2 +
stride[2]*y)) =
r;
233 *((uint16_t*)(
src[3] + x*2 +
stride[3]*y)) =
a;
235 *((uint16_t*)(
src[0] + x*2 +
stride[0]*y)) =
b;
236 *((uint16_t*)(
src[1] + x*2 +
stride[1]*y)) =
g;
237 *((uint16_t*)(
src[2] + x*2 +
stride[2]*y)) =
r;
static av_always_inline void predict(PredictorState *ps, int *coef, int output_enable)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define i(width, name, range_min, range_max)
static struct @346255127015250356166251341105367306144006377143 state
static const uint8_t bits[8]
void ff_ffv1_compute_bits_per_plane(const FFV1Context *f, FFV1SliceContext *sc, int bits[4], int *offset, int mask[4], int bits_per_raw_sample)
static av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed)
static int get_vlc_symbol(GetBitContext *gb, VlcState *const state, int bits)
static int is_input_end(RangeCoder *c, GetBitContext *gb, int ac)
static unsigned int get_bits1(GetBitContext *s)
static int get_bits_count(const GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const int16_t quant_table[64]
static const uint16_t mask[17]
const uint8_t ff_log2_run[41]
static int get_rac(RangeCoder *c, uint8_t *const state)
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)