@@ -2721,10 +2721,10 @@ static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
for (i = 0; i < nb_components; i++) {
- int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1);
- if (src_desc->comp[i].depth - 1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
+ int depth = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components + 1 : dst_desc->comp[i].depth;
+ if (src_desc->comp[i].depth > depth && (consider & FF_LOSS_DEPTH)) {
loss |= FF_LOSS_DEPTH;
- score -= 65536 >> depth_minus1;
+ score -= 131072 >> depth;
}
}
Signed-off-by: Nicolas George <george@nsup.org> --- libavutil/pixdesc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)