diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-21 19:49:53 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-21 20:07:17 +0100 |
commit | c9ad2e9aa3dae110c0ae5d347a521f1acd61063a (patch) | |
tree | 4af50131ba3b883ddb3a7f91865924267790070b /libavcodec/imgconvert.c | |
parent | 0705cbd0026fb17ef0f66846ebd29d7886d266bf (diff) | |
download | ffmpeg-c9ad2e9aa3dae110c0ae5d347a521f1acd61063a.tar.gz |
imgconvert: remove avg_bits_per_pixel(), its redundant
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/imgconvert.c')
-rw-r--r-- | libavcodec/imgconvert.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 3bac58dad3..3daf604703 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -177,13 +177,6 @@ int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, return loss; } -static int avg_bits_per_pixel(enum AVPixelFormat pix_fmt) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); - - return av_get_padded_bits_per_pixel(desc); -} - #if FF_API_FIND_BEST_PIX_FMT enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr) @@ -236,8 +229,8 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt loss_order2 = loss2 & loss_mask_order[i]; if (loss_order1 == 0 && loss_order2 == 0 && dst_pix_fmt2 != AV_PIX_FMT_NONE && dst_pix_fmt1 != AV_PIX_FMT_NONE){ /* use format with smallest depth */ - if(avg_bits_per_pixel(dst_pix_fmt2) != avg_bits_per_pixel(dst_pix_fmt1)) { - dst_pix_fmt = avg_bits_per_pixel(dst_pix_fmt2) < avg_bits_per_pixel(dst_pix_fmt1) ? dst_pix_fmt2 : dst_pix_fmt1; + if(av_get_padded_bits_per_pixel(desc2) != av_get_padded_bits_per_pixel(desc1)) { + dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1; } else { dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1; } @@ -644,7 +637,7 @@ int main(void){ AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i); if(!desc) continue; - av_log(0, AV_LOG_INFO, "pix fmt %s yuv_plan:%d avg_bpp:%d colortype:%d\n", desc->name, is_yuv_planar(desc), avg_bits_per_pixel(i), get_color_type(desc)); + av_log(0, AV_LOG_INFO, "pix fmt %s yuv_plan:%d avg_bpp:%d colortype:%d\n", desc->name, is_yuv_planar(desc), av_get_padded_bits_per_pixel(desc), get_color_type(desc)); } return 0; } |