aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-07-04 10:22:53 +0200
committerAnton Khirnov <anton@khirnov.net>2024-08-01 10:09:25 +0200
commit54aa33f116b9451a50a39cffd5cec5bfd21a47a8 (patch)
treeaa3758d55a05b614e8aea697faa352a7e2cbd1f3 /libavcodec/ffv1.h
parentd845ea49c5b6039df18f935103cbef588f223799 (diff)
downloadffmpeg-54aa33f116b9451a50a39cffd5cec5bfd21a47a8.tar.gz
lavc/ffv1: add a per-slice context
FFV1 decoder and encoder currently use the same struct - FFV1Context - both as codec private data and per-slice context. For this purpose FFV1Context contains an array of pointers to per-slice FFV1Context instances. This pattern is highly confusing, as it is not clear which fields are per-slice and which per-codec. Address this by adding a new struct storing only per-slice data. Start by moving slice_{x,y,width,height} to it.
Diffstat (limited to 'libavcodec/ffv1.h')
-rw-r--r--libavcodec/ffv1.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/libavcodec/ffv1.h b/libavcodec/ffv1.h
index d99367ce81..256904b283 100644
--- a/libavcodec/ffv1.h
+++ b/libavcodec/ffv1.h
@@ -69,6 +69,13 @@ typedef struct PlaneContext {
#define MAX_SLICES 1024
+typedef struct FFV1SliceContext {
+ int slice_width;
+ int slice_height;
+ int slice_x;
+ int slice_y;
+} FFV1SliceContext;
+
typedef struct FFV1Context {
AVClass *class;
AVCodecContext *avctx;
@@ -123,14 +130,12 @@ typedef struct FFV1Context {
int max_slice_count;
int num_v_slices;
int num_h_slices;
- int slice_width;
- int slice_height;
- int slice_x;
- int slice_y;
int slice_reset_contexts;
int slice_coding_mode;
int slice_rct_by_coef;
int slice_rct_ry_coef;
+
+ FFV1SliceContext *slices;
} FFV1Context;
int ff_ffv1_common_init(AVCodecContext *avctx);