Path: blob/21.2-virgl/src/gallium/frontends/omx/vid_dec_h264_common.h
4561 views
/**************************************************************************1*2* Copyright 2013 Advanced Micro Devices, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627#ifndef VID_DEC_H264_COMMON_H28#define VID_DEC_H264_COMMON_H2930#include "vid_dec_common.h"3132#define OMX_VID_DEC_AVC_DEFAULT_FRAME_WIDTH 17633#define OMX_VID_DEC_AVC_DEFAULT_FRAME_HEIGHT 14434#define OMX_VID_DEC_AVC_DEFAULT_FRAME_RATE 15<<1635#define OMX_VID_DEC_AVC_ROLE "video_decoder.avc"36/* With libtizonia, port indexes must start at index 0 */37#define OMX_VID_DEC_AVC_INPUT_PORT_INDEX 038#define OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX 139#define OMX_VID_DEC_AVC_INPUT_PORT_MIN_BUF_COUNT 840#define OMX_VID_DEC_AVC_OUTPUT_PORT_MIN_BUF_COUNT 441/* 38016 = (width * height) + ((width * height)/2) */42#define OMX_VID_DEC_AVC_PORT_MIN_INPUT_BUF_SIZE 3801643#define OMX_VID_DEC_AVC_PORT_MIN_OUTPUT_BUF_SIZE 34560044#define OMX_VID_DEC_AVC_PORT_NONCONTIGUOUS OMX_FALSE45#define OMX_VID_DEC_AVC_PORT_ALIGNMENT 046#define OMX_VID_DEC_AVC_PORT_SUPPLIERPREF OMX_BufferSupplyInput47#define OMX_VID_DEC_AVC_TIMESTAMP_INVALID ((OMX_TICKS) -1)4849#define DPB_MAX_SIZE 55051struct dpb_list {52struct list_head list;53struct pipe_video_buffer *buffer;54OMX_TICKS timestamp;55int poc;56};5758static const uint8_t Default_4x4_Intra[16] = {596, 13, 20, 28, 13, 20, 28, 32,6020, 28, 32, 37, 28, 32, 37, 4261};6263static const uint8_t Default_4x4_Inter[16] = {6410, 14, 20, 24, 14, 20, 24, 27,6520, 24, 27, 30, 24, 27, 30, 3466};6768static const uint8_t Default_8x8_Intra[64] = {696, 10, 13, 16, 18, 23, 25, 27,7010, 11, 16, 18, 23, 25, 27, 29,7113, 16, 18, 23, 25, 27, 29, 31,7216, 18, 23, 25, 27, 29, 31, 33,7318, 23, 25, 27, 29, 31, 33, 36,7423, 25, 27, 29, 31, 33, 36, 38,7525, 27, 29, 31, 33, 36, 38, 40,7627, 29, 31, 33, 36, 38, 40, 4277};7879static const uint8_t Default_8x8_Inter[64] = {809, 13, 15, 17, 19, 21, 22, 24,8113, 13, 17, 19, 21, 22, 24, 25,8215, 17, 19, 21, 22, 24, 25, 27,8317, 19, 21, 22, 24, 25, 27, 28,8419, 21, 22, 24, 25, 27, 28, 30,8521, 22, 24, 25, 27, 28, 30, 32,8622, 24, 25, 27, 28, 30, 32, 33,8724, 25, 27, 28, 30, 32, 33, 3588};8990struct pipe_video_buffer *vid_dec_h264_Flush(vid_dec_PrivateType *priv,91OMX_TICKS *timestamp);92void vid_dec_h264_EndFrame(vid_dec_PrivateType *priv);93void vid_dec_h264_Decode(vid_dec_PrivateType *priv, struct vl_vlc *vlc, unsigned min_bits_left);94void vid_dec_FreeInputPortPrivate(OMX_BUFFERHEADERTYPE *buf);95void vid_dec_FrameDecoded_common(vid_dec_PrivateType*priv, OMX_BUFFERHEADERTYPE* input,96OMX_BUFFERHEADERTYPE* output);9798#endif99100101