summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-25 17:50:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-25 17:50:55 +0200
commit3f4c0dad16b853fdd16ef89de1b082b9333737c3 (patch)
tree1c49e9e5ca926340e3442df5eec2d790bcb0f28f /libavcodec/ffv1.c
parent60217b5b9cf713b1eeb7626473eac357cde25673 (diff)
ffv1: move init_slice_state() into the decoder threads.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ffv1.c')
-rw-r--r--libavcodec/ffv1.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index c31c3ff51e..c906ca6791 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -1601,12 +1601,13 @@ static int decode_slice(AVCodecContext *c, void *arg){
AVFrame * const p= &f->picture;
if(f->version > 2){
- if(decode_slice_header(f, fs) < 0)
- return AVERROR_INVALIDDATA;
-
if(init_slice_state(f, fs) < 0)
return AVERROR(ENOMEM);
+ if(decode_slice_header(f, fs) < 0)
+ return AVERROR_INVALIDDATA;
}
+ if(init_slice_state(f, fs) < 0)
+ return AVERROR(ENOMEM);
if(f->picture.key_frame)
clear_slice_state(f, fs);
width = fs->slice_width;
@@ -1968,8 +1969,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
f->key_frame_ok = 0;
if(read_header(f) < 0)
return -1;
- if(init_slices_state(f) < 0)
- return -1;
f->key_frame_ok = 1;
}else{
if (!f->key_frame_ok) {
@@ -1978,13 +1977,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
}
p->key_frame= 0;
}
- if(f->ac>1){
- int i;
- for(i=1; i<256; i++){
- c->one_state[i]= f->state_transition[i];
- c->zero_state[256-i]= 256-c->one_state[i];
- }
- }
p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){