OSDN Git Service

vp9enc: limit min_qp of brc to be non-zero
authorZhong Li <zhong.li@intel.com>
Thu, 16 Nov 2017 09:05:14 +0000 (17:05 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 27 Nov 2017 19:14:44 +0000 (11:14 -0800)
If base_qindex (luma_ac_qindex) is equal to zero, the enode mode will be
lossless mode when
luma_dc_qindex_delta/chroma_ac_qindex_delta/chroma_dc_qindex_delta are
also zero. In this case, the tx_mode should be set to ONLY_4X4, but current
driver only support TX_MODE_SELECT. This will cause the lossless mode
encoding failure.
Limitting the min_qp to be non-zero can force the encoding mode to be normal
mode.
It is to fix issue #284

Signed-off-by: Zhong Li <zhong.li@intel.com>
src/gen9_vp9_encoder.c

index 8389dde..a9f2c8c 100644 (file)
@@ -1059,7 +1059,7 @@ void gen9_vp9_set_curbe_brc(VADriverContextP ctx,
         cmd->dw13.init_frame_width   = pic_param->frame_width_src;
         cmd->dw13.init_frame_height   = pic_param->frame_height_src;
 
-        cmd->dw15.min_qp          = 0;
+        cmd->dw15.min_qp          = 1;
         cmd->dw15.max_qp          = 255;
 
         cmd->dw16.cq_level            = 30;
@@ -1108,7 +1108,7 @@ void gen9_vp9_set_curbe_brc(VADriverContextP ctx,
         break;
     }
     case VP9_MEDIA_STATE_BRC_UPDATE: {
-        cmd->dw15.min_qp          = 0;
+        cmd->dw15.min_qp          = 1;
         cmd->dw15.max_qp          = 255;
 
         cmd->dw25.frame_number    = param->frame_number;