From patchwork Sat Mar 27 23:35:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 26626 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 403ED44B707 for ; Sun, 28 Mar 2021 01:35:25 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1450068A3BF; Sun, 28 Mar 2021 01:35:25 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 327186804DA for ; Sun, 28 Mar 2021 01:35:18 +0200 (EET) Received: by mail-pg1-f176.google.com with SMTP id e33so6993543pgm.13 for ; Sat, 27 Mar 2021 16:35:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=bmSEyTEbCuxdIr/ynKlj3nHZAzqS5DtC33X2Ik0M0P0=; b=l8yU+OZ56B72IeOG0UcxLhGkFnHy+U7D/O7frVysMIZOGq3CHr0WAalGijiXOXGlu8 Fze2ejGVcSZkaxML+17OAN0bGqIS5kuQZr1wO7KzT7UBYlUz3dL3w8drg7I3I+TbG7d4 nuoA8KI3+TH0s3rhIkwx3ynbT7QhSvUNyqryhBdEOJ3crBfE0y+O7QP1HrV+dJ1rdfcx jXJKV5q74tkZ7ZVT2/wz+l2UmtgaLYPB2GrSJDRTzlNF8ZzgkYHis4G+I/EGfYRMCn9h Z8rQLeInhlKBcDEobQpQy4wzkLZtUfUyb8NbQv9bz9+rYFG08yYJ0DIPfG93dIItosRv LWNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=bmSEyTEbCuxdIr/ynKlj3nHZAzqS5DtC33X2Ik0M0P0=; b=j8W9B59e4/NCVfoxdQaeT3ObsbgM5IkVys71mvi3MXWQ8l/cGLbVAWelCQLDAISbHY 5EOWzEJ3VRVybUBsrdk2GqTiHUrVAkjecjgG9z17l4jnOQ0tJB3Z20kViCsxFGyibvek b2MYjHSwISFJGWcILPQbOnMUYLQjrm9VG7phJh3k1evVq4+aC3685hGUAjF4uywahNZh fBSylIR5OUR7FXmPnWnq0NVtS9zqtJ58CYaYX+oaOj+JlqOoTn34c5A+HW/dKi7lxJHe x6KgiRs3nEgE0mPoj1vofYW4NmtDYZiz0g1/sKEF8nISf1auna41hHRo9B7qbQgbG1Uu 6/vw== X-Gm-Message-State: AOAM533up0pML0C8zI/gHi1Fji79FqffiotLzQIlfwunFV2V1YZ2pWJi Ea5XCbxfI5IO9LGayGV2zdczmlyQqHy+lI274FPD+uZdwlk= X-Google-Smtp-Source: ABdhPJxaK/3NQCZD9Ar8V9Tt3OPNcs9D+1HonkgjE+d2MaO70JvtUoIHvkByGPuSFCtBqK7CnsyZFcczTVhYL/uqFd8= X-Received: by 2002:aa7:8498:0:b029:1f6:8a25:7ade with SMTP id u24-20020aa784980000b02901f68a257ademr18987442pfn.76.1616888116078; Sat, 27 Mar 2021 16:35:16 -0700 (PDT) MIME-Version: 1.0 From: Carl Eugen Hoyos Date: Sun, 28 Mar 2021 00:35:05 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH]lavc/mjpegdec: Support pixel format 0x11311100 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! Attached patch fixes decoding of a sample mentioned in ticket #8930. Please comment, Carl Eugen Subject: [PATCH] lavc/mjpegdec: Support pixel format 0x11311100. Fixes decoding of Nene3xRGB.jpg --- libavcodec/mjpegdec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 5583d2aa35..575b2d8d4a 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -615,6 +615,17 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; } break; + case 0x11311100: + if (s->bits > 8) + goto unk_pixfmt; + if (s->component_id[0] == 'R' - 1 && s->component_id[1] == 'G' - 1 && s->component_id[2] == 'B' - 1) { + s->avctx->pix_fmt = AV_PIX_FMT_GBRP; + } else { + goto unk_pixfmt; + } + s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; + s->upscale_h[1] = s->upscale_h[2] = 2; + break; case 0x31111100: if (s->bits > 8) goto unk_pixfmt;