diff mbox

[FFmpeg-devel,1/2] avcodec/libaomdec: remove duplicate code

Message ID 20180401195904.7356-1-jamrial@gmail.com
State Accepted
Headers show

Commit Message

James Almer April 1, 2018, 7:59 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
libaom generates all files as I4xx16 right now, so the code i'm
removing here is unused. And even if it ends up generating I4xx files
down the road, it's safe to assume the bit_depth field in aom_image_t
will still be populated.

 libavcodec/libaomdec.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

Comments

James Almer April 3, 2018, 6:51 p.m. UTC | #1
On 4/1/2018 4:59 PM, James Almer wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> libaom generates all files as I4xx16 right now, so the code i'm
> removing here is unused. And even if it ends up generating I4xx files
> down the road, it's safe to assume the bit_depth field in aom_image_t
> will still be populated.
> 

Patchset pushed.
diff mbox

Patch

diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 1352b421d9..e0d3a3b7fe 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -95,18 +95,6 @@  static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
 
     switch (img->fmt) {
     case AOM_IMG_FMT_I420:
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-        avctx->profile = FF_PROFILE_AV1_MAIN;
-        return 0;
-    case AOM_IMG_FMT_I422:
-        avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-        avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
-        return 0;
-    case AOM_IMG_FMT_I444:
-        avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
-                         AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
-        avctx->profile = FF_PROFILE_AV1_HIGH;
-        return 0;
     case AOM_IMG_FMT_I42016:
         if (img->bit_depth == 8) {
             avctx->pix_fmt = AV_PIX_FMT_YUV420P;
@@ -123,6 +111,7 @@  static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
         } else {
             return AVERROR_INVALIDDATA;
         }
+    case AOM_IMG_FMT_I422:
     case AOM_IMG_FMT_I42216:
         if (img->bit_depth == 8) {
             avctx->pix_fmt = AV_PIX_FMT_YUV422P;
@@ -139,6 +128,7 @@  static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
         } else {
             return AVERROR_INVALIDDATA;
         }
+    case AOM_IMG_FMT_I444:
     case AOM_IMG_FMT_I44416:
         if (img->bit_depth == 8) {
             avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?