From patchwork Mon Oct 2 17:24:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Roche X-Patchwork-Id: 5386 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.61.8 with SMTP id n8csp1759782jan; Mon, 2 Oct 2017 10:33:25 -0700 (PDT) X-Received: by 10.28.74.80 with SMTP id x77mr10547697wma.79.1506965605079; Mon, 02 Oct 2017 10:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506965605; cv=none; d=google.com; s=arc-20160816; b=zp++GcshaasYsb287us2x/3CUUx51qLztJo5VaEDlip3iUL0+ffd7J7bXroeq6xyUy +oOHIbdiMDXG5lzKQAKPFGOY5oHr6Etbw3B978vz73KeQVYzMG2ZYzVqrJ991YwJps+m 9eYJ0sq+oWWLh8aHvFw1qN19/Uz5W8XCoYScnKrXyuCtfDoeiT1mHnZ/eWE0F7zhT7/4 IilvDfNo3veHAS8Vd9Lk1eLQrnPVZbx9djoAuZTQblqas1peb34HW3P/XBnduK5wbeip WIdz9/ilc1pr1mdGaGoY53qt1bnRfnYJW5w48bX9iWCOIeep2529/hmrYkl0NzUrolWl ZtcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=2tLn8BHtTuY72VbXf7M11d3sSSUbaiSf8x1XaOcot2Y=; b=NWbCNMmtJGGm7zdXVxFy2KJvcQ+lf1kEr+gfXDgtOpICW17QsmvWmOyVGcmsxTNPTC ijjQHy3A76AK+KdYTYeBD6tY47m5t6gkad3sV2QO4AuXolSj2NKbvwpHTV8PhfiNlA9Y db3ag6vWL4prwUdudt4NNXFwAjmFgbxiZTcqnhj32Eh2dtYjXR8BWPUi2Q9eG0itCsCn /C5dk4ThakZyW31GrJFBHvCKO2kDSal9FlNB47bwuvyg1rfjDO8ratZxUvrpIuMhxjKT ruJJyLbNncjCMChs8vd3A+drs36Bw0KdtgveFPt8iJ0asiTcSqmrP2SxGNeh812jVnbz 8cIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@giphy.com header.s=google header.b=GI9myNdu; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a130si184505wme.262.2017.10.02.10.33.24; Mon, 02 Oct 2017 10:33:25 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@giphy.com header.s=google header.b=GI9myNdu; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C0096689F2E; Mon, 2 Oct 2017 20:33:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt0-f179.google.com (mail-qt0-f179.google.com [209.85.216.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5E174689EA8 for ; Mon, 2 Oct 2017 20:33:01 +0300 (EEST) Received: by mail-qt0-f179.google.com with SMTP id 47so8190728qts.10 for ; Mon, 02 Oct 2017 10:33:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=giphy.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kzPgpW7FaezTKWBSLZJEwByRsI7KlJIvaWmwbLo/d0s=; b=GI9myNdugYWSlzGXBZUjNZjv5nMH9syE1h6cXlYT3Cpev7XTaEJagfl65ld9fFDaVJ 2MEAWegf1cUtljDV3tkZHaemxMZYFscl1mwedhypT3UBmMpOHdXaQhxBwJCg9saThlKb 3r25Mt7NdOa++zi09wid8hmgiDCoFgj+nhjc8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kzPgpW7FaezTKWBSLZJEwByRsI7KlJIvaWmwbLo/d0s=; b=W9cXws4fRfEQJi1mcq5PEIcAjxy7GSrFQxDeMENGLCxQH1jCkOx9QlIKgWNiGguzIq VPs+6uKlrYqIBmOHNv5glMgnYsX7qZsRjYUeqxOZfaZq5JI1vZjTu/LATULPOQ/IYPVt zZfeCiOAT+KpLQMX0sWR99fjfyPP2AZf66rtCAdYEx6MZnPcRVY3AS0mf7UbjcuOcUd2 78j0mpYwEe0c5tLctqRA51ohbJZelLm4Mkpifc6XlJ2Doy3f2T3/IrxdqR44ierWIC9k a7UuX76uHRxAKziSZFO3k4m6yvZaErcf/FEGC8LfDThaX/OCH+Hbst7/CQ/BLRW72g8K u4bA== X-Gm-Message-State: AMCzsaWwVefTaXsQqeIpA72aym/2G5utxCGyNQF1ygMiVJ/B831Q4vbQ ogwIv/IWKdjenQKVHqxJAgp7xiFhyRA= X-Google-Smtp-Source: AOwi7QBAyQA5jIvMbPgdHl6sqC1Y0pUDS+k2mQw9HOsROYO6/sGy5LZHHhhigtRKq9yFb10p+Q9Low== X-Received: by 10.200.49.232 with SMTP id i37mr20394885qte.281.1506965106111; Mon, 02 Oct 2017 10:25:06 -0700 (PDT) Received: from localhost.localdomain ([208.184.100.82]) by smtp.gmail.com with ESMTPSA id p25sm7339001qte.28.2017.10.02.10.25.05 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 02 Oct 2017 10:25:05 -0700 (PDT) From: Bjorn Roche To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Oct 2017 13:24:38 -0400 Message-Id: <20171002172439.65628-7-bjorn@giphy.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171002172439.65628-1-bjorn@giphy.com> References: <20171002172439.65628-1-bjorn@giphy.com> Subject: [FFmpeg-devel] [PATCH 6/7] cleanup 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 Cc: Bjorn Roche MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Bjorn Roche --- libavcodec/gif.c | 14 +++++--------- libavformat/gif.c | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/libavcodec/gif.c b/libavcodec/gif.c index 3838aa7592..3ced6d4d45 100644 --- a/libavcodec/gif.c +++ b/libavcodec/gif.c @@ -265,7 +265,7 @@ static int gif_image_write_translucent(AVCodecContext *avctx, int x_end = w - 1, y_end = h - 1; - // top + // crop top while (y_start < y_end) { int i; int is_trans = 1; @@ -280,7 +280,7 @@ static int gif_image_write_translucent(AVCodecContext *avctx, ++y_start; } - // bottom + // crop bottom while (y_end < h) { int i; int is_trans = 1; @@ -295,7 +295,7 @@ static int gif_image_write_translucent(AVCodecContext *avctx, --y_end; } - // left + // crop left while (x_start < x_end) { int i; int is_trans = 1; @@ -310,7 +310,7 @@ static int gif_image_write_translucent(AVCodecContext *avctx, ++x_start; } - // right + // crop right while (x_end < w) { int i; int is_trans = 1; @@ -326,15 +326,11 @@ static int gif_image_write_translucent(AVCodecContext *avctx, } height = y_end + 1 - y_start; - width = x_end + 1 - x_start; + width = x_end + 1 - x_start; av_log(avctx, AV_LOG_DEBUG,"%dx%d image at pos (%d;%d) [area:%dx%d]\n", width, height, x_start, y_start, avctx->width, avctx->height); } - // for( int i=0; iwidth*avctx->height; ++i ) { - // ((uint8_t *)buf)[i] = 120; - // } - uint8_t *frame_disposal = av_packet_new_side_data(pkt, AV_PKT_DATA_GIF_FRAME_DISPOSAL, 1); if (!frame_disposal) diff --git a/libavformat/gif.c b/libavformat/gif.c index 853e84430e..4662720049 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -176,7 +176,7 @@ static int flush_packet(AVFormatContext *s, AVPacket *new) } else { packed = 1<<2 | (bcid >= 0); } - //FIXME: if disposal == 2, make sure backgrdoun color is specified appropriately. + avio_w8(pb, 0x21); avio_w8(pb, 0xf9); avio_w8(pb, 0x04); /* block size */