25 int plane_index,
int bits)
32 int run_index =
s->run_index;
37 if (
s->slice_coding_mode == 1) {
39 for (x = 0; x <
w; x++) {
50 for (x = 0; x <
w; x++) {
51 int diff, context, sign;
70 if (context == 0 && run_mode == 0)
74 if (run_count == 0 && run_mode == 1) {
77 if (x + run_count <=
w)
90 while (run_count > 1 &&
w-x > 1) {
96 while (run_count > 1 &&
w-x > 1) {
115 ff_dlog(
s->avctx,
"count:%d index:%d, mode:%d, x:%d pos:%d\n",
124 s->run_index = run_index;
132 int lbd =
s->avctx->bits_per_raw_sample <= 8;
133 int bits =
s->avctx->bits_per_raw_sample > 0 ?
s->avctx->bits_per_raw_sample : 8;
135 int transparency =
s->transparency;
137 for (x = 0; x < 4; x++) {
139 sample[x][1] =
RENAME(
s->sample_buffer) + (x * 2 + 1) * (
w + 6) + 3;
144 memset(
RENAME(
s->sample_buffer), 0, 8 * (
w + 6) *
sizeof(*
RENAME(
s->sample_buffer)));
146 for (y = 0; y <
h; y++) {
147 for (p = 0; p < 3 + transparency; p++) {
156 if (lbd &&
s->slice_coding_mode == 0)
163 for (x = 0; x <
w; x++) {
169 if (
s->slice_coding_mode != 1) {
172 g -= (
b *
s->slice_rct_by_coef +
r *
s->slice_rct_ry_coef) >> 2;
178 *((uint32_t*)(
src[0] + x*4 +
stride[0]*y)) =
b + ((
unsigned)
g<<8) + ((
unsigned)
r<<16) + ((
unsigned)
a<<24);
179 else if (
sizeof(
TYPE) == 4 || transparency) {
180 *((uint16_t*)(
src[0] + x*2 +
stride[0]*y)) =
g;
181 *((uint16_t*)(
src[1] + x*2 +
stride[1]*y)) =
b;
182 *((uint16_t*)(
src[2] + x*2 +
stride[2]*y)) =
r;
184 *((uint16_t*)(
src[3] + x*2 +
stride[3]*y)) =
a;
186 *((uint16_t*)(
src[0] + x*2 +
stride[0]*y)) =
b;
187 *((uint16_t*)(
src[1] + x*2 +
stride[1]*y)) =
g;
188 *((uint16_t*)(
src[2] + x*2 +
stride[2]*y)) =
r;
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
const uint8_t ff_log2_run[41]
static int RENAME() get_context(PlaneContext *p, TYPE *src, TYPE *last, TYPE *last2)
static int get_vlc_symbol(GetBitContext *gb, VlcState *const state, int bits)
static av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed)
static int is_input_end(FFV1Context *s)
static av_always_inline int RENAME() decode_line(FFV1Context *s, int w, TYPE *sample[2], int plane_index, int bits)
static int RENAME() decode_rgb_frame(FFV1Context *s, uint8_t *src[4], int w, int h, int stride[4])
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 av_always_inline void predict(PredictorState *ps, float *coef, int output_enable)
static int get_rac(RangeCoder *c, uint8_t *const state)
uint8_t(* state)[CONTEXT_SIZE]
static av_always_inline int diff(const uint32_t a, const uint32_t b)
static const uint8_t offset[127][2]