From patchwork Mon Dec 10 01:54:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 11354 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 B8BEE44C4F8 for ; Mon, 10 Dec 2018 03:54:57 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0C55868AA14; Mon, 10 Dec 2018 03:54:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it1-f173.google.com (mail-it1-f173.google.com [209.85.166.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 01E5168AA83 for ; Mon, 10 Dec 2018 03:54:45 +0200 (EET) Received: by mail-it1-f173.google.com with SMTP id a6so15585257itl.4 for ; Sun, 09 Dec 2018 17:54:56 -0800 (PST) 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=/5l1PvAfY0S9KNQegrZ5joWKQyriDo1A+kraeVWPVQU=; b=fyExcGrMe0r19Yhd3qmaXglOWKk7OHey7Sp2XgXtit2sYVRSg40e3Adb8CkBSaXnxC RuZTibpQ4PCkJ+F+UUpeSsyCTZfnX0WabuVhAMC2Dpfs0Aaql59x8cEr2GEMG1wkSXfH 1OYQml0akhTIElAHmHhcG1GDbJaA/fvjou0wTqIbuShZ4qqiwGki6S2uKNjwq9/Ekt9E jEV7nZF0JLp3xQQ7k/PTlbJXl4YWXEbPYgD3ZdqMsixAr4BddJvCeOcD3ehnLeMr/Hil ngNmDrQ2+iY2jdUrrEXSZorTgPDLWKvj9FR3d+fO3rzARU0VrF5aR5uajDWiqqplNohv 66/g== 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=/5l1PvAfY0S9KNQegrZ5joWKQyriDo1A+kraeVWPVQU=; b=ITcgkY4T8kE86cXjA+hk5XVYuK23ZKDZZU5qIZwzKDpzRAvhBdupx52bpTiXcTg9Tu crla9W3eTeGsr22KF++hHXEZpmD0eDt+wQtvKzvLFQODp09BDy5kyAAFuCXeUEf9HoTw VVM3cw0zk8Xu5JuWf10TNqRvmEnWIvP6DJ4axRoO0MLlh0+QwZRIs9rrEmnRtq52g5nQ ocSb2RaKK1WDPbGh/u0td0ZzDN7XKzz/EXN6Ti0AESBEF9WSsCxuWoC0HdUYX9rczFgW piRzCLaDamDJkvaoFRgHNSZHp8NmGQ+BfqmCYHBw4eVu2JJUEu+bVncFCbbUUsbzv5wM LWhA== X-Gm-Message-State: AA+aEWYoXXnEhmnrBf2ytZanaiAP2ZbBTlMwxQ/abDV7rJhMNE1VeU8p 8o77C/M4O4VMhYh3snvrbg66yalXnQdxsnsQL2mBFw== X-Google-Smtp-Source: AFSGD/UWc9ysbn+EEyJRLSuPPVDiRmB8cM5OavaIzQgRtmNggh8kz6BGKep8euCBE5JDO0RkU3ROphKsxlF17OPUenw= X-Received: by 2002:a24:130a:: with SMTP id 10mr9369213itz.58.1544406894955; Sun, 09 Dec 2018 17:54:54 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a02:5f11:0:0:0:0:0 with HTTP; Sun, 9 Dec 2018 17:54:54 -0800 (PST) From: Carl Eugen Hoyos Date: Mon, 10 Dec 2018 02:54:54 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [RFC]lavc/mjpegenc_common: Fix aspect ratio 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! Reading the specification and Wikipedia, it appears to me that FFmpeg is writing wrong values as aspect ratio for jfif files. I hope somebody can prove me wrong! This would need a slightly more sophisticated update to the decoder. Please comment, Carl Eugen From 9c42114da17c20ef6d81d3989b5521eaefc15819 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 10 Dec 2018 02:50:39 +0100 Subject: [PATCH] lavc/mjpegenc_common: Fix aspect ratio. Reported-by: Ulf Zibis --- libavcodec/mjpegenc_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c index 31868c9..1d3ee55 100644 --- a/libavcodec/mjpegenc_common.c +++ b/libavcodec/mjpegenc_common.c @@ -187,8 +187,8 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p) * released revision. */ put_bits(p, 16, 0x0102); put_bits(p, 8, 0); /* units type: 0 - aspect ratio */ - put_bits(p, 16, sar.num); put_bits(p, 16, sar.den); + put_bits(p, 16, sar.num); put_bits(p, 8, 0); /* thumbnail width */ put_bits(p, 8, 0); /* thumbnail height */ } -- 1.7.10.4