video: driver: fix hevc codec layer count support

Support only 4 total layers for hevc non vbr rc type session
as per PRD.

Change-Id: Ifc425de75804552717919e6be71788dd59fb086b
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
Dieser Commit ist enthalten in:
Akshata Sahukar
2022-08-04 11:03:20 -07:00
committet von Ashish Patil
Ursprung 203f09ac3f
Commit ec161663ce
2 geänderte Dateien mit 11 neuen und 5 gelöschten Zeilen

Datei anzeigen

@@ -73,7 +73,8 @@ enum msm_vidc_metadata_bits {
#define MAX_VP9D_INST_COUNT 6
/* TODO: move below macros to waipio.c */
#define MAX_ENH_LAYER_HB 3
#define MAX_HEVC_ENH_LAYER_SLIDING_WINDOW 5
#define MAX_HEVC_VBR_ENH_LAYER_SLIDING_WINDOW 5
#define MAX_HEVC_NON_VBR_ENH_LAYER_SLIDING_WINDOW 3
#define MAX_AVC_ENH_LAYER_SLIDING_WINDOW 3
#define MAX_AVC_ENH_LAYER_HYBRID_HP 5
#define INVALID_DEFAULT_MARK_OR_USE_LTR -1

Datei anzeigen

@@ -1817,7 +1817,7 @@ static int msm_vidc_adjust_static_layer_count_and_type(struct msm_vidc_inst *ins
inst->hfi_layer_type = HFI_HIER_P_HYBRID_LTR;
}
/* sanitize layer count based on layer type and codec */
/* sanitize layer count based on layer type and codec, and rc type */
if (inst->hfi_layer_type == HFI_HIER_B) {
if (layer_count > MAX_ENH_LAYER_HB)
layer_count = MAX_ENH_LAYER_HB;
@@ -1828,9 +1828,14 @@ static int msm_vidc_adjust_static_layer_count_and_type(struct msm_vidc_inst *ins
if (inst->codec == MSM_VIDC_H264) {
if (layer_count > MAX_AVC_ENH_LAYER_SLIDING_WINDOW)
layer_count = MAX_AVC_ENH_LAYER_SLIDING_WINDOW;
} else {
if (layer_count > MAX_HEVC_ENH_LAYER_SLIDING_WINDOW)
layer_count = MAX_HEVC_ENH_LAYER_SLIDING_WINDOW;
} else if (inst->codec == MSM_VIDC_HEVC) {
if (inst->hfi_rc_type == HFI_RC_VBR_CFR) {
if (layer_count > MAX_HEVC_VBR_ENH_LAYER_SLIDING_WINDOW)
layer_count = MAX_HEVC_VBR_ENH_LAYER_SLIDING_WINDOW;
} else {
if (layer_count > MAX_HEVC_NON_VBR_ENH_LAYER_SLIDING_WINDOW)
layer_count = MAX_HEVC_NON_VBR_ENH_LAYER_SLIDING_WINDOW;
}
}
}