From patchwork Sun Sep 1 13:20:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 14831 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 1B4624427A8 for ; Sun, 1 Sep 2019 16:20:47 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0A851687F26; Sun, 1 Sep 2019 16:20:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3666768049A for ; Sun, 1 Sep 2019 16:20:40 +0300 (EEST) Received: by mail-pl1-f176.google.com with SMTP id 4so5365579pld.10 for ; Sun, 01 Sep 2019 06:20:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EMsM+C4mQvuc7jKYqdUCcksNpjgPN1El78ExHZocKbs=; b=uUX+xp5imWG9N5IfrYFGEQqY8a7yJ5mQCoMS5F9oit/zLyrVEc9Cvj3AMF7reTVqG7 +afzPyAQAcTw6HLAJtKKkJ4skPUckO9RXpUpZvMkXLU5TGnXuXntjUxrF2fxPjw+wEcz xVyx3AfDOEefX85HWA2aUpGoPvSiXOUx7t8n5NfJtHwMyMN3dpJ+2MD3+KSNYNGlnZit dymzYtzhfD69U9iSvVl8tJP5JvX+Uej6f+M4deEJosbo9r0aaOtbuLQ2+Xz9YJkyIoj/ hKyDgTjUBboH8aCRa6hpojaRI1kXNDIZLuIsl+lkgR3T+NG/xF6qZoDtARfjBglVg7mf dWJg== 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=EMsM+C4mQvuc7jKYqdUCcksNpjgPN1El78ExHZocKbs=; b=G+Ny4sq4VsjS4/yg7CVqDWyhAgXePgSmZDLsLDGJxsyrE3h/DikIEda6A6rpeD5Sts JzfzneKRhMZlQGWJyhmURRbP3WM4PJVXQwatMcEJTuFgCLZRWgLyajaCr7KfkrYkKtc8 finqTIT2WzsWbmaafQLhjE+sH18o/hIkoZFAIHyXOfZqvCurnzdtsnc8uv0t1M0puHZ/ YG9ZjAOXwLyCwp/IAsPlw/Ut/jAy6j0J1h9amFI1QJcRrMQiYQqF3+IF1+owrjcFBr4J DbmIflCRoIbZiOOZS3fR6P/4vInDTdgbeR0gZTbQD7IXYXonuzYwlt/raYBNzMVtWG2X VuRw== X-Gm-Message-State: APjAAAULTENy1Rc8XVLrIAKGy3C/DEP6h9E+9CgCnRGHQZ3PhRNkj/lq lgXInoCwF3CszI083nYFfXOVeF8x X-Google-Smtp-Source: APXvYqwrED7Zmalzqhwq0O+8qSBoWaCnCeQK3ZivENviLKoXrro3T0W57KkQniX18Yzb5Vfl/QeJkw== X-Received: by 2002:a17:902:a8:: with SMTP id a37mr24089584pla.316.1567344038490; Sun, 01 Sep 2019 06:20:38 -0700 (PDT) Received: from vpn.localdomain ([47.90.99.151]) by smtp.gmail.com with ESMTPSA id b14sm12587039pfo.15.2019.09.01.06.20.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Sep 2019 06:20:37 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Sun, 1 Sep 2019 21:20:21 +0800 Message-Id: <20190901132023.28531-3-lance.lmwang@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190901132023.28531-1-lance.lmwang@gmail.com> References: <1567007116-9088-1-git-send-email-lance.lmwang@gmail.com> <20190901132023.28531-1-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v3 3/5] libavcodec/v210enc: move the duplicate code to template file 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/v210_template.c | 48 +++++++++++++++++++++++++++++++++++++++++ libavcodec/v210enc.c | 54 +++++++++++++--------------------------------- 2 files changed, 63 insertions(+), 39 deletions(-) create mode 100644 libavcodec/v210_template.c diff --git a/libavcodec/v210_template.c b/libavcodec/v210_template.c new file mode 100644 index 0000000..00036ae --- /dev/null +++ b/libavcodec/v210_template.c @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2009 Michael Niedermayer + * Copyright (c) 2009 Baptiste Coudurier + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "bytestream.h" +#include "internal.h" + +#define CLIP(v, depth) av_clip(v, 1<<(depth-8), ((1<