summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1dec.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2015-11-22 16:55:56 +0000
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2015-11-22 16:57:43 +0000
commitbba2488f074904069e38865654413ec44d35ec24 (patch)
treee9a6a7ec8dc52da3901726389f9e7fbb7abf58ce /libavcodec/ffv1dec.c
parent3c110b009b8efd3650f1b8caf31c331ee775f0ee (diff)
parent4bb1070c154e49d35805fbcdac9c9e92f702ef96 (diff)
Merge commit '4bb1070c154e49d35805fbcdac9c9e92f702ef96'
* commit '4bb1070c154e49d35805fbcdac9c9e92f702ef96': ffv1: Explicitly name the coder type Conflicts: libavcodec/ffv1.h libavcodec/ffv1dec.c libavcodec/ffv1enc.c Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r--libavcodec/ffv1dec.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index a14329a512..c01d65ffbe 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -133,7 +133,7 @@ static av_always_inline void decode_line(FFV1Context *s, int w,
av_assert2(context < p->context_count);
- if (s->ac) {
+ if (s->ac != AC_GOLOMB_RICE) {
diff = get_symbol_inline(c, p->state[context], 1);
} else {
if (context == 0 && run_mode == 0)
@@ -423,7 +423,7 @@ static int decode_slice(AVCodecContext *c, void *arg)
x = fs->slice_x;
y = fs->slice_y;
- if (!fs->ac) {
+ if (fs->ac == AC_GOLOMB_RICE) {
if (f->version == 3 && f->micro_version > 1 || f->version > 3)
get_rac(&fs->c, (uint8_t[]) { 129 });
fs->ac_byte_count = f->version > 2 || (!x && !y) ? fs->c.bytestream - fs->c.bytestream_start - 1 : 0;
@@ -452,7 +452,7 @@ static int decode_slice(AVCodecContext *c, void *arg)
p->data[2] + ps * x + y * p->linesize[2] };
decode_rgb_frame(fs, planes, width, height, p->linesize);
}
- if (fs->ac && f->version > 2) {
+ if (fs->ac != AC_GOLOMB_RICE && f->version > 2) {
int v;
get_rac(&fs->c, (uint8_t[]) { 129 });
v = fs->c.bytestream_end - fs->c.bytestream - 2 - 5*f->ec;
@@ -539,8 +539,9 @@ static int read_extra_header(FFV1Context *f)
if (f->micro_version < 0)
return AVERROR_INVALIDDATA;
}
- f->ac = f->avctx->coder_type = get_symbol(c, state, 0);
- if (f->ac > 1) {
+ f->ac = get_symbol(c, state, 0);
+
+ if (f->ac == AC_RANGE_CUSTOM_TAB) {
for (i = 1; i < 256; i++)
f->state_transition[i] = get_symbol(c, state, 1) + c->one_state[i];
}
@@ -646,8 +647,9 @@ static int read_header(FFV1Context *f)
return AVERROR_INVALIDDATA;
}
f->version = v;
- f->ac = f->avctx->coder_type = get_symbol(c, state, 0);
- if (f->ac > 1) {
+ f->ac = get_symbol(c, state, 0);
+
+ if (f->ac == AC_RANGE_CUSTOM_TAB) {
for (i = 1; i < 256; i++)
f->state_transition[i] = get_symbol(c, state, 1) + c->one_state[i];
}