aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utvideoenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-28 21:16:29 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-01 01:01:50 +0200
commitb2f5899ec2062f209b9a4d4277910678c6d55f79 (patch)
tree976489a192f33c1caee371c2f2467754e3daaefb /libavcodec/utvideoenc.c
parent0e18f1e9a3c1abefc0a945727490550427cee2cb (diff)
downloadffmpeg-b2f5899ec2062f209b9a4d4277910678c6d55f79.tar.gz
avcodec/utvideo: Split UTvideoContext into decoder and encoder contexts
In particular the encoder used only a small part of the context: The new encoder context is only 128B here. It used to be 32992. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/utvideoenc.c')
-rw-r--r--libavcodec/utvideoenc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index 6e87bbc2b6..1fcb6854f2 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -33,11 +33,28 @@
#include "encode.h"
#include "bswapdsp.h"
#include "bytestream.h"
+#include "lossless_videoencdsp.h"
#include "put_bits.h"
#include "mathops.h"
#include "utvideo.h"
#include "huffman.h"
+typedef struct UtvideoContext {
+ const AVClass *class;
+ BswapDSPContext bdsp;
+ LLVidEncDSPContext llvidencdsp;
+
+ uint32_t frame_info_size, flags;
+ int planes;
+ int slices;
+ int compression;
+ int frame_pred;
+
+ ptrdiff_t slice_stride;
+ uint8_t *slice_bits, *slice_buffer[4];
+ int slice_bits_size;
+} UtvideoContext;
+
typedef struct HuffEntry {
uint16_t sym;
uint8_t len;
@@ -76,7 +93,6 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
int i, subsampled_height;
uint32_t original_format;
- c->avctx = avctx;
c->frame_info_size = 4;
c->slice_stride = FFALIGN(avctx->width, 32);