media: aspeed: refine to avoid full jpeg update
The switch of jpeg 420/444 subsampling will update full jpeg header for aspeed now. Just update the 420/444 subsampling part of jpeg header is fine. Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
83ffdc3292
commit
164646a785
@ -422,6 +422,21 @@ static void aspeed_video_init_jpeg_table(u32 *table, bool yuv420)
|
||||
}
|
||||
}
|
||||
|
||||
// just update jpeg dct table per 420/444
|
||||
static void aspeed_video_update_jpeg_table(u32 *table, bool yuv420)
|
||||
{
|
||||
int i;
|
||||
unsigned int base;
|
||||
|
||||
for (i = 0; i < ASPEED_VIDEO_JPEG_NUM_QUALITIES; i++) {
|
||||
base = 256 * i; /* AST HW requires this header spacing */
|
||||
base += ASPEED_VIDEO_JPEG_HEADER_SIZE +
|
||||
ASPEED_VIDEO_JPEG_DCT_SIZE;
|
||||
|
||||
table[base + 2] = (yuv420) ? 0x00220103 : 0x00110103;
|
||||
}
|
||||
}
|
||||
|
||||
static void aspeed_video_update(struct aspeed_video *video, u32 reg, u32 clear,
|
||||
u32 bits)
|
||||
{
|
||||
@ -1289,7 +1304,7 @@ static void aspeed_video_update_jpeg_quality(struct aspeed_video *video)
|
||||
static void aspeed_video_update_subsampling(struct aspeed_video *video)
|
||||
{
|
||||
if (video->jpeg.virt)
|
||||
aspeed_video_init_jpeg_table(video->jpeg.virt, video->yuv420);
|
||||
aspeed_video_update_jpeg_table(video->jpeg.virt, video->yuv420);
|
||||
|
||||
if (video->yuv420)
|
||||
aspeed_video_update(video, VE_SEQ_CTRL, 0, VE_SEQ_CTRL_YUV420);
|
||||
|
Loading…
x
Reference in New Issue
Block a user