Skip to content
Commit 0aeccc63 authored by Fei Shao's avatar Fei Shao Committed by Hans Verkuil
Browse files

media: mtk-jpegenc: Fix bug in JPEG encode quality selection

The driver uses the upper-bound approach to decide the target JPEG
encode quality, but there's a logic bug that if the desired quality is
higher than what the driver can support, the driver falls back to using
the worst quality.

Fix the bug by assuming using the best quality in the beginning, and
with trivial refactor to avoid long lines.

Fixes: 45f13a57

 ("media: platform: Add jpeg enc feature")
Signed-off-by: default avatarFei Shao <fshao@chromium.org>
Reviewed-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent c3cad51c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment