aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2018-12-11 12:48:25 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2018-12-11 12:48:25 +0100
commit1d371cda319b7224931ea70ad9c16eb46f1e9c07 (patch)
tree108263bc2cf66f8ac30495fbd610fc44865896a2
parent89d62bea2528f05fb07f2ab70fbf7d9926dce381 (diff)
v4l-stream.c: add support for alpha planes
Support was added to the fwht codec to handle alpha planes, but v4l-stream.c was never updated for that. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/common/v4l-stream.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/common/v4l-stream.c b/utils/common/v4l-stream.c
index af096c25..9f842e21 100644
--- a/utils/common/v4l-stream.c
+++ b/utils/common/v4l-stream.c
@@ -198,7 +198,7 @@ struct codec_ctx *fwht_alloc(unsigned pixfmt, unsigned w, unsigned h,
ctx->state.quantization = quantization;
ctx->flags = 0;
chroma_div = info->width_div * info->height_div;
- ctx->size = size + 2 * size / chroma_div;
+ ctx->size = 2 * size + 2 * size / chroma_div;
ctx->state.ref_frame.luma = malloc(ctx->size);
ctx->comp_max_size = ctx->size + sizeof(struct fwht_cframe_hdr);
ctx->state.compressed_frame = malloc(ctx->comp_max_size);
@@ -211,6 +211,7 @@ struct codec_ctx *fwht_alloc(unsigned pixfmt, unsigned w, unsigned h,
ctx->state.ref_frame.width = ctx->state.ref_frame.height = 0;
ctx->state.ref_frame.cb = ctx->state.ref_frame.luma + size;
ctx->state.ref_frame.cr = ctx->state.ref_frame.cb + size / chroma_div;
+ ctx->state.ref_frame.alpha = ctx->state.ref_frame.cr + size / chroma_div;
ctx->state.gop_size = 10;
ctx->state.gop_cnt = 0;
return ctx;

Privacy Policy