vp8.h revision 90d3ed91ae9228e1c8bab561b6138d4cb8c1e4fd
13742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/* 23742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * Copyright (c) 2010 The VP8 project authors. All Rights Reserved. 33742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * 43742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * Use of this source code is governed by a BSD-style license and patent 53742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * grant that can be found in the LICENSE file in the root of the source 63742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * tree. All contributing project authors may be found in the AUTHORS 73742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * file in the root of the source tree. 83742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */ 93742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 103742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 113742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/*!\defgroup vp8 VP8 123742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * \ingroup codecs 133742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * VP8 is vpx's newest video compression algorithm that uses motion 143742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * compensated prediction, Discrete Cosine Transform (DCT) coding of the 153742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * prediction error signal and context dependent entropy coding techniques 163742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * based on arithmatic principles. It features: 173742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * - YUV 4:2:0 image format 183742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * - Macro-block based coding (16x16 luma plus two 8x8 chroma) 193742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * - 1/4 (1/8) pixel accuracy motion compensated prediction 203742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * - 4x4 DCT transform 213742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * - 128 level linear quantizer 223742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * - In loop deblocking filter 233742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * - Context-based entropy coding 243742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * 253742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * @{ 263742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */ 273742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/*!\file vp8.h 283742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * \brief Provides controls common to both the VP8 encoder and decoder. 293742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */ 303742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman#ifndef VP8_H 313742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman#define VP8_H 323742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman#include "vpx_codec_impl_top.h" 333742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 343742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/*!\brief Control functions 353742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * 363742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * The set of macros define the control functions of VP8 interface 373742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */ 383742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romanenum vp8_dec_control_id 393742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman{ 403742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */ 413742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */ 423742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_SET_POSTPROC = 3, /**< set decoder's the post processing settings */ 433742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_COMMON_CTRL_ID_MAX 443742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman}; 453742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 463742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/*!\brief post process flags 473742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * 483742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * The set of macros define VP8 decoder post processing flags 493742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */ 503742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romanenum vp8_postproc_level 513742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman{ 523742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_NOFILTERING = 0, 533742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_DEBLOCK = 1, 543742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_DEMACROBLOCK = 2, 553742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_ADDNOISE = 4, 563742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman}; 573742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 583742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/*!\brief post process flags 593742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * 603742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * This define a structure that describe the post processing settings. For 613742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * the best objective measure (using thet PSNR metric) set post_proc_flag 623742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * to VP8_DEBLOCK and deblocking_level to 1. 633742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */ 643742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 653742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romantypedef struct vp8_postproc_cfg 663742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman{ 673742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */ 683742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */ 693742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman int noise_level; /**< the strength of additive noise, valid range [0, 16] */ 703742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman} vp8_postproc_cfg_t; 713742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 723742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/*!\brief reference frame type 733742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * 743742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * The set of macros define the type of VP8 reference frames 753742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */ 763742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romantypedef enum vpx_ref_frame_type 773742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman{ 783742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_LAST_FRAME = 1, 793742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_GOLD_FRAME = 2, 803742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman VP8_ALTR_FRAME = 4 813742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman} vpx_ref_frame_type_t; 823742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 833742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/*!\brief reference frame data struct 843742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * 853742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * define the data struct to access vp8 reference frames 863742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */ 873742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 883742d9db8b6edb10627b0f89336cca5249f1d15aManuel Romantypedef struct vpx_ref_frame 893742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman{ 903742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman vpx_ref_frame_type_t frame_type; /**< which reference frame */ 913742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman vpx_image_t img; /**< reference frame data in image format */ 923742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman} vpx_ref_frame_t; 933742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 943742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 953742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/*!\brief vp8 decoder control funciton parameter type 963742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * 973742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * defines the data type for each of VP8 decoder control funciton requires 983742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */ 993742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 1003742d9db8b6edb10627b0f89336cca5249f1d15aManuel RomanVPX_CTRL_USE_TYPE(VP8_SET_REFERENCE, vpx_ref_frame_t *) 1013742d9db8b6edb10627b0f89336cca5249f1d15aManuel RomanVPX_CTRL_USE_TYPE(VP8_COPY_REFERENCE, vpx_ref_frame_t *) 1023742d9db8b6edb10627b0f89336cca5249f1d15aManuel RomanVPX_CTRL_USE_TYPE(VP8_SET_POSTPROC, vp8_postproc_cfg_t *) 1033742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 1043742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 1053742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/*! @} - end defgroup vp8 */ 1063742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 1073742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman#if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT 1083742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman/* The following definitions are provided for backward compatibility with 1093742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman * the VP8 1.0.x SDK. USE IN PRODUCTION CODE IS NOT RECOMMENDED. 1103742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman */ 1113742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 1123742d9db8b6edb10627b0f89336cca5249f1d15aManuel RomanDECLSPEC_DEPRECATED extern vpx_codec_iface_t vpx_codec_vp8_algo DEPRECATED; 1133742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman#endif 1143742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman 1153742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman#include "vpx_codec_impl_bottom.h" 1163742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman#endif 1173742d9db8b6edb10627b0f89336cca5249f1d15aManuel Roman