[FFmpeg-devel] [PATCH 1/2] avcodec/hap: pass texture-compression destination as argument, not in context
Tom Butterworth
bangnoise at gmail.com
Tue Nov 8 02:21:52 EET 2016
This allows a subsequent change to compress directly into the output packet when possible.
---
libavcodec/hapenc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c
index 076923b..7056b62 100644
--- a/libavcodec/hapenc.c
+++ b/libavcodec/hapenc.c
@@ -52,10 +52,9 @@ enum HapHeaderLength {
HAP_HDR_LONG = 8,
};
-static void compress_texture(AVCodecContext *avctx, const AVFrame *f)
+static void compress_texture(AVCodecContext *avctx, uint8_t *out, const AVFrame *f)
{
HapContext *ctx = avctx->priv_data;
- uint8_t *out = ctx->tex_buf;
int i, j;
for (j = 0; j < avctx->height; j += 4) {
@@ -201,7 +200,7 @@ static int hap_encode(AVCodecContext *avctx, AVPacket *pkt,
return ret;
/* DXTC compression. */
- compress_texture(avctx, frame);
+ compress_texture(avctx, ctx->tex_buf, frame);
/* Compress (using Snappy) the frame */
final_data_size = hap_compress_frame(avctx, pkt->data + header_length);
--
2.9.3 (Apple Git-75)
More information about the ffmpeg-devel
mailing list