blob: ba4bf6589c3b7d819582601a41d9014206fcffe4 [file] [log] [blame]
From 5baae2b5aa8f1c66fad12d6dc4cd2b649233ffd1 Mon Sep 17 00:00:00 2001
From: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Date: Fri, 24 Apr 2020 16:24:34 -0800
Subject: [PATCH] gen9_vp9_encoder: Relax the compressed frames minimum size
restriction.
The current implementation of the CQP mode encode has a
compressed buffer size restriction of 4Kb. The restriction
doesn't make sense for low-resolution & low-bitrate
video encoding use cases since inter-frames can be encoded
with much less number of bytes.
For eg: most of the P-frames in a video-conferencing session
of 640x480 resolution at 750kbps require only 1Kb bitrate
allocation and currently the hardware PAK unit fill the rest
of the 3Kb (4Kb-1Kb) with zeros. This will jeopardize the
quality & bit-rate allocation of the hybrid CBR encode
models[1] where we run the bitrate control algorithm in
software clubbed with a CQP hardware encoder:
[1]: https://cgit.freedesktop.org/~sree/gstreamer-vaapi/commit/?h=VP9_SVC_and_SoftwareBRC&id=355f16bdb32965425b274aa082c1334b0edd5992).
---
src/gen9_vp9_encoder.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/gen9_vp9_encoder.c b/src/gen9_vp9_encoder.c
index 0180235..0a1670f 100644
--- a/src/gen9_vp9_encoder.c
+++ b/src/gen9_vp9_encoder.c
@@ -1593,7 +1593,10 @@ intel_vp9enc_construct_picstate_batchbuf(VADriverContextP ctx,
*cmd_ptr++ = 0;
/* dw31 */
- *cmd_ptr++ = (0 << 30) | 1;
+ /* dw31 is for restricting the compressed frames minimum size
+ * and we don't impose any. */
+ *cmd_ptr++ = 0;
+
/* dw32 */
*cmd_ptr++ = vp9_state->frame_header.bit_offset_first_partition_size;
--
2.20.1