diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-11-15 23:26:07 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-11-16 12:56:31 +0100 |
commit | 4bb1070c154e49d35805fbcdac9c9e92f702ef96 (patch) | |
tree | 8feca3a3ab44d19cab72718c24bddb803bd12ce4 /libavcodec/ffv1.c | |
parent | 9fd2bf09dbc630484d9e88a1d27f7e8508b70a2c (diff) | |
download | ffmpeg-4bb1070c154e49d35805fbcdac9c9e92f702ef96.tar.gz |
ffv1: Explicitly name the coder type
FFv1 uses two types of coders, golomb and range with two different
tables. This is exposed this in a rather convoluted way, for example
mentioning to set coder type 1 while initializing the variable 'ac' to 2,
because encoder does not use range coder with default table.
Appropriate internal coder type values have been added and used in any
check rather than using raw numbers.
Initialization of avctx.coder_type in ffv1dec is removed because this
field is encoder only. An unneeded validation check in the encoder
is dropped too.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/ffv1.c')
-rw-r--r-- | libavcodec/ffv1.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 0836d42012..3a6c7fac16 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -160,7 +160,7 @@ int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) for (j = 0; j < f->plane_count; j++) { PlaneContext *const p = &fs->plane[j]; - if (fs->ac) { + if (fs->ac != AC_GOLOMB_RICE) { if (!p->state) p->state = av_malloc(CONTEXT_SIZE * p->context_count * sizeof(uint8_t)); @@ -174,7 +174,7 @@ int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) } } - if (fs->ac > 1) { + if (fs->ac == AC_RANGE_CUSTOM_TAB) { //FIXME only redo if state_transition changed for (j = 1; j < 256; j++) { fs->c.one_state[j] = f->state_transition[j]; @@ -257,7 +257,7 @@ void ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs) p->interlace_bit_state[0] = 128; p->interlace_bit_state[1] = 128; - if (fs->ac) { + if (fs->ac != AC_GOLOMB_RICE) { if (f->initial_states[p->quant_table_index]) { memcpy(p->state, f->initial_states[p->quant_table_index], CONTEXT_SIZE * p->context_count); |