From patchwork Sat Nov 11 23:21:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 6002 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp561468jah; Sat, 11 Nov 2017 15:22:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMYw9dBYc6ULNQxI175wOd8Gg0L5JT0xnh6Ur9Kac+Tk09uH2kwi6QKdQfP5PB+JZ6PQhfqY X-Received: by 10.223.173.129 with SMTP id w1mr3788026wrc.19.1510442533390; Sat, 11 Nov 2017 15:22:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510442533; cv=none; d=google.com; s=arc-20160816; b=QcNrhj/9qBpNKJ4p4SUhIQSwmqKS951JfIFVEVrdE0y+RGJAbe14uBaOZRPItvRlqh bLjyeFvos3jKQsFS3BqUEt1Ijshw5CzD3mrlQInmBDxmURM+iQ9V/ZHxzWTr2xWPStM4 C46Lrv3mV2LJfOTOLm/EJgybAw/qJCDHri4Lcylif2WvIR+8dcrWlQ3kXSg+7BqpeMGv QwUTj1ocmq9H58r7W+wdfq6hPa2Did0dJoLKP4yAQNSjNkdJBCB5AGkaOI6zBWIEYEKO r7t9G/rk0bEAcfzFKv+5KJzlr84R4em/pf0xSxlQ3HEQpHVr6ApBOnhtedDlqGuo/fZi 3qvA== 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:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=Ca6ogBfAKvDB2kXHINNLDu5v7gOPrnCGeeWJgTaAmaM=; b=qL1L9tswxC/tUqGrZHOuPJH/B1bg0UskLi9OM4b05tSDARO0nIbGOd7STsrQj5XRXn TEHStQhe+99k5MyNNyvx8j2ZXjR4d4RKUekADqSYSwhlkMV8R5IDmFnjGCADMXNQqAy0 nXr1yx2b1y5In67N8PkOnY3lrEw0jW1gH4oLfEUnf99PqMiGFEzLcEHf56KZxmiarHyu 44os92JBKWygupKrBNl+OpwM84VfvE0TL9RrIz8DFiItwFm34UozZJzeF4y6bygq5mPN HmphF4PHwnLkLIVDiyD6W4AzhNEK+X51Co7Ohfrpj/sB6/4aR4PQ0HZVzNfyXAIsHfn0 d8uQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h12si10589589wrc.83.2017.11.11.15.22.12; Sat, 11 Nov 2017 15:22:13 -0800 (PST) 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; 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 587C168A230; Sun, 12 Nov 2017 01:21:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-2.mx.upcmail.net (vie01a-qmta-pe02-2.mx.upcmail.net [62.179.121.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D32B368A219 for ; Sun, 12 Nov 2017 01:21:50 +0200 (EET) Received: from [172.31.218.53] (helo=vie01a-dmta-pe08-2.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eDf6C-0004VO-D1 for ffmpeg-devel@ffmpeg.org; Sun, 12 Nov 2017 00:22:04 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eDf66-0002pV-FB for ffmpeg-devel@ffmpeg.org; Sun, 12 Nov 2017 00:21:58 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id YnMv1w00C0S5wYM01nMw8s; Sun, 12 Nov 2017 00:21:56 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 12 Nov 2017 00:21:54 +0100 Message-Id: <20171111232154.25593-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.15.0 Subject: [FFmpeg-devel] [PATCH] avutil: add API for mb_types 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This is based on motion_type.h Signed-off-by: Michael Niedermayer --- libavutil/block_type.h | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 libavutil/block_type.h diff --git a/libavutil/block_type.h b/libavutil/block_type.h new file mode 100644 index 0000000000..1531c7b420 --- /dev/null +++ b/libavutil/block_type.h @@ -0,0 +1,89 @@ +/* + * 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 + */ + +#ifndef AVUTIL_BLOCK_TYPE_H +#define AVUTIL_BLOCK_TYPE_H + +#include + +typedef struct AVBlockType { + /** + * Extra flag information. + */ + uint64_t flags; +#define AV_BLOCK_TYPE_FLAG_INTRA 0x0000001 ///< Block is a intra block, else inter + +#define AV_BLOCK_TYPE_FLAG_BIDIR 0x0000002 ///< Block uses bidirectional motion compensation +#define AV_BLOCK_TYPE_FLAG_GMC 0x0000004 ///< Block uses global motion compensation +#define AV_BLOCK_TYPE_FLAG_SKIP 0x0000008 ///< Block is skiped +#define AV_BLOCK_TYPE_FLAG_CMV 0x0000010 ///< Block has concealment motion vector(s) +#define AV_BLOCK_TYPE_FLAG_LOOP 0x0000020 ///< Block uses a loop filter +#define AV_BLOCK_TYPE_FLAG_WEIGHT 0x0000040 ///< Block uses weighted prediction +#define AV_BLOCK_TYPE_FLAG_OBMC 0x0000080 ///< Block uses overlapped block MC + +#define AV_BLOCK_TYPE_FLAG_DCPRED 0x0000100 ///< Block uses spatial DC prediction +#define AV_BLOCK_TYPE_FLAG_ACPRED 0x0000200 ///< Block uses spatial AC prediction +#define AV_BLOCK_TYPE_FLAG_PCM 0x0000400 ///< Block is PCM coded +#define AV_BLOCK_TYPE_FLAG_IPRED 0x0000800 ///< Block uses interlaced prediction + +#define AV_BLOCK_TYPE_FLAG_LEAF 0x0001000 ///< Block is a leaf block, it is not further split +#define AV_BLOCK_TYPE_FLAG_ROOT 0x0002000 ///< Block is a root block, it is not contained in a larger block + +#define AV_BLOCK_TYPE_FLAG_CONCEALED 0x0010000 ///< Block has been replaced by error conclealment +#define AV_BLOCK_TYPE_FLAG_DC_DAMAGED 0x0020000 ///< Block has damaged DC coeffs +#define AV_BLOCK_TYPE_FLAG_AC_DAMAGED 0x0040000 ///< Block has damaged AC coeffs +#define AV_BLOCK_TYPE_FLAG_MV_DAMAGED 0x0080000 ///< Block has damaged MV +#define AV_BLOCK_TYPE_FLAG_CODED_DC 0x0100000 ///< Block has coded DC coefficients +#define AV_BLOCK_TYPE_FLAG_CODED_AC 0x0200000 ///< Block has coded AC coefficients +#define AV_BLOCK_TYPE_FLAG_CODED_MV 0x0400000 ///< Block has coded MV diff + +#define AV_BLOCK_TYPE_FLAG_ITRANSFORM 0x0800000 ///< Block uses interlaced transform + + + /** + * Left Top corner position. + */ + uint16_t x, y; + /** + * Width and height of the block. + */ + uint8_t w, h; + /** + * Quantization parameter, a value of -128 means lossless, 127 means not applicable + */ + int8_t qp; + /** + * Direction of prediction, 0 is horizontal, 48 is vertical, + * values 0 to 95 follow clockwise direction. + * 254 means the block uses planar prediction + * 255 means that the block has no prediction direction. + */ + uint8_t pred_direction; + /** + * Direction of transform, 0 is horizontal, 48 is vertical, + * values 0 to 95 follow clockwise direction. + * 255 means that the block has no directional transform. + */ + uint8_t transform_direction; + /** + * Number identifying the slice the MB is in. + */ + uint8_t slice_num; +} AVBlockType; + +#endif /* AVUTIL_BLOCK_TYPE_H */