summaryrefslogtreecommitdiff
authormiaohong chen <miaohong.chen@amlogic.com>2020-07-27 08:52:31 (GMT)
committer Gan Zhang <gan.zhang@amlogic.com>2020-07-28 10:31:46 (GMT)
commit4ea926a49ae2643832b1c78e05f0d8a76c7374c7 (patch)
treeaa28dbdfad42a20f05d464109820130e235c2902
parent95ac8483ee82404a213828147ec2bdc6e6827462 (diff)
downloadmedia_modules-4ea926a49ae2643832b1c78e05f0d8a76c7374c7.zip
media_modules-4ea926a49ae2643832b1c78e05f0d8a76c7374c7.tar.gz
media_modules-4ea926a49ae2643832b1c78e05f0d8a76c7374c7.tar.bz2
vmh264: fix bug of abnormal cropping. [1/1]
PD#SWPL-28943 Problem: chroma_format_idc may not exist, causing misuse, resulting in abnormal crop Solution: According to grammar rules, when chroma_format_idc does not exist, set it to 1. Verify: u212 Change-Id: Iba5624a7d3b542b00b677d1c062dd23af6b0131d Signed-off-by: miaohong chen <miaohong.chen@amlogic.com>
Diffstat
-rw-r--r--drivers/frame_provider/decoder/h264_multi/vmh264.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c
index 4257a8b..948b436 100644
--- a/drivers/frame_provider/decoder/h264_multi/vmh264.c
+++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c
@@ -4812,6 +4812,12 @@ static int vh264_set_params(struct vdec_h264_hw_s *hw,
bit 15: frame_mbs_only_flag
bit 13-14: chroma_format_idc */
frame_mbs_only_flag = (hw->seq_info >> 15) & 0x01;
+ if (p_H264_Dpb->mSPS.profile_idc != 100 &&
+ p_H264_Dpb->mSPS.profile_idc != 110 &&
+ p_H264_Dpb->mSPS.profile_idc != 122 &&
+ p_H264_Dpb->mSPS.profile_idc != 144) {
+ p_H264_Dpb->chroma_format_idc = 1;
+ }
chroma_format_idc = p_H264_Dpb->chroma_format_idc;
/* @AV_SCRATCH_6.31-16 = (left << 8 | right ) << 1
@@ -8376,6 +8382,12 @@ static int vmh264_get_ps_info(struct vdec_h264_hw_s *hw,
* bit 13-14: chroma_format_idc
*/
frame_mbs_only_flag = (hw->seq_info >> 15) & 0x01;
+ if (hw->dpb.mSPS.profile_idc != 100 &&
+ hw->dpb.mSPS.profile_idc != 110 &&
+ hw->dpb.mSPS.profile_idc != 122 &&
+ hw->dpb.mSPS.profile_idc != 144) {
+ hw->dpb.chroma_format_idc = 1;
+ }
chroma_format_idc = hw->dpb.chroma_format_idc;
/*