mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-02-04 14:30:55 +08:00
avcodec/ffv1: Store and reuse sx/sy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7151081e33)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -144,6 +144,8 @@ av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
|
||||
sc->slice_height = sye - sys;
|
||||
sc->slice_x = sxs;
|
||||
sc->slice_y = sys;
|
||||
sc->sx = sx;
|
||||
sc->sy = sy;
|
||||
|
||||
sc->sample_buffer = av_malloc_array((f->width + 6), 3 * MAX_PLANES *
|
||||
sizeof(*sc->sample_buffer));
|
||||
|
||||
@@ -75,6 +75,7 @@ typedef struct FFV1SliceContext {
|
||||
int slice_height;
|
||||
int slice_x;
|
||||
int slice_y;
|
||||
int sx, sy;
|
||||
|
||||
int run_index;
|
||||
int slice_coding_mode;
|
||||
|
||||
@@ -923,8 +923,8 @@ static void encode_slice_header(FFV1Context *f, FFV1SliceContext *sc)
|
||||
int j;
|
||||
memset(state, 128, sizeof(state));
|
||||
|
||||
put_symbol(c, state, (sc->slice_x +1)*f->num_h_slices / f->width , 0);
|
||||
put_symbol(c, state, (sc->slice_y +1)*f->num_v_slices / f->height , 0);
|
||||
put_symbol(c, state, sc->sx, 0);
|
||||
put_symbol(c, state, sc->sy, 0);
|
||||
put_symbol(c, state, 0, 0);
|
||||
put_symbol(c, state, 0, 0);
|
||||
for (j=0; j<f->plane_count; j++) {
|
||||
|
||||
Reference in New Issue
Block a user