diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-20 14:50:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-20 15:37:23 +0200 |
commit | 32883c0667c9516bb3e1507c334170eea8371da8 (patch) | |
tree | 69bce64982514955fa988dacb6427b394f6b0af3 /libavcodec/ffv1.c | |
parent | d7a4c43f1830a23f8acd71bea567f7908a99a539 (diff) | |
download | ffmpeg-32883c0667c9516bb3e1507c334170eea8371da8.tar.gz |
ffv1: split init_slice_state() out so individual slices can be inited
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ffv1.c')
-rw-r--r-- | libavcodec/ffv1.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 860c00707b..2bad0f2d53 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -696,11 +696,9 @@ static av_cold int common_init(AVCodecContext *avctx){ return 0; } -static int init_slice_state(FFV1Context *f){ - int i, j; +static int init_slice_state(FFV1Context *f, FFV1Context *fs){ + int j; - for(i=0; i<f->slice_count; i++){ - FFV1Context *fs= f->slice_context[i]; fs->plane_count= f->plane_count; fs->transparency= f->transparency; for(j=0; j<f->plane_count; j++){ @@ -724,11 +722,20 @@ static int init_slice_state(FFV1Context *f){ fs->c.zero_state[256-j]= 256-fs->c.one_state [j]; } } - } return 0; } +static int init_slices_state(FFV1Context *f){ + int i; + for(i=0; i<f->slice_count; i++){ + FFV1Context *fs= f->slice_context[i]; + if(init_slice_state(f, fs) < 0) + return -1; + } + return 0; +} + static av_cold int init_slice_contexts(FFV1Context *f){ int i; @@ -1089,7 +1096,7 @@ static av_cold int encode_init(AVCodecContext *avctx) if(init_slice_contexts(s) < 0) return -1; - if(init_slice_state(s) < 0) + if(init_slices_state(s) < 0) return -1; #define STATS_OUT_SIZE 1024*1024*6 @@ -1824,7 +1831,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac p->key_frame= 1; if(read_header(f) < 0) return -1; - if(init_slice_state(f) < 0) + if(init_slices_state(f) < 0) return -1; clear_state(f); |