summaryrefslogtreecommitdiffstats
path: root/libhb/enc_qsv.c
diff options
context:
space:
mode:
authormaxd <[email protected]>2018-01-09 08:37:48 +0100
committerScott <[email protected]>2018-01-10 19:31:13 +0000
commit72b0bbcb5fb9ad26f64e7594fd2046f301af117e (patch)
tree6eaff912b8d5b52755b494fe31607cc692df3866 /libhb/enc_qsv.c
parent876adad03617eed88bd38f3e310835eed812bfc6 (diff)
qsv: better dimensions adjustments for HEVC 10b
Diffstat (limited to 'libhb/enc_qsv.c')
-rw-r--r--libhb/enc_qsv.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libhb/enc_qsv.c b/libhb/enc_qsv.c
index 05771b7e5..b5d387b44 100644
--- a/libhb/enc_qsv.c
+++ b/libhb/enc_qsv.c
@@ -304,9 +304,11 @@ static int qsv_hevc_make_header(hb_work_object_t *w, mfxSession session)
}
/* need more space for 10bits */
+ int bpp12 = 3;
if (pv->param.videoParam->mfx.FrameInfo.FourCC == MFX_FOURCC_P010)
{
hb_buffer_realloc(bitstream_buf,bitstream_buf->size*2);
+ bpp12 = 6;
}
bitstream.Data = bitstream_buf->data;
bitstream.MaxLength = bitstream_buf->alloc;
@@ -315,9 +317,9 @@ static int qsv_hevc_make_header(hb_work_object_t *w, mfxSession session)
mfxU16 Height = pv->param.videoParam->mfx.FrameInfo.Height;
mfxU16 Width = pv->param.videoParam->mfx.FrameInfo.Width;
frameSurface1.Info = pv->param.videoParam->mfx.FrameInfo;
- frameSurface1.Data.Y = av_mallocz(Width * Height * 3 / 2);
- frameSurface1.Data.VU = frameSurface1.Data.Y + Width * Height;
- frameSurface1.Data.Pitch = Width;
+ frameSurface1.Data.Y = av_mallocz(Width * Height * (bpp12 / 2.0));
+ frameSurface1.Data.VU = frameSurface1.Data.Y + Width * Height * (bpp12 == 6 ? 2 : 1);
+ frameSurface1.Data.Pitch = Width * (bpp12 == 6 ? 2 : 1);
/* Encode a single blank frame */
do