Skip to content

Commit

Permalink
vpp: set default aspect when the ratecontrol is zero [1/1]
Browse files Browse the repository at this point in the history
PD#TV-5266

Problem:
Vpp used the wrong aspect ratio in 3D, screen mode = normal
and aspect ratio is 0 in ratecontrol variable.

Solution:
When the aspect ratio is 0, set the default value as
(height << 8) / width

Verify:
Verified by x301

Change-Id: I34f7cd3ce5ed1818d3090ebb4be934225038625e
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
  • Loading branch information
Brian Zhu authored and kongsuozt committed May 23, 2019
1 parent 1cf9d61 commit 1cd025d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/amlogic/media/video_sink/vpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3068,6 +3068,18 @@ int vpp_set_filters(
aspect_ratio = (vf->ratio_control & DISP_RATIO_ASPECT_RATIO_MASK)
>> DISP_RATIO_ASPECT_RATIO_BIT;

if (!aspect_ratio) {
u32 sar_width, sar_height;

if (vf->type & VIDTYPE_COMPRESS) {
sar_width = vf->compWidth;
sar_height = vf->compHeight;
} else {
sar_width = vf->width;
sar_height = vf->height;
}
aspect_ratio = (sar_height << 8) / sar_width;
}
/* the height from vdin afbc will be half */
/* so need no interlace in */
if ((vf->type & VIDTYPE_INTERLACE)
Expand Down

0 comments on commit 1cd025d

Please sign in to comment.