1 /* 2 * gstvaapiutils_mpeg2_priv.h - MPEG-2 related utilities 3 * 4 * Copyright (C) 2011-2014 Intel Corporation 5 * Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com> 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public License 9 * as published by the Free Software Foundation; either version 2.1 10 * of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free 19 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * Boston, MA 02110-1301 USA 21 */ 22 23 #ifndef GST_VAAPI_UTILS_MPEG2_PRIV_H 24 #define GST_VAAPI_UTILS_MPEG2_PRIV_H 25 26 #include "gstvaapiutils_mpeg2.h" 27 #include "gstvaapisurface.h" 28 29 G_BEGIN_DECLS 30 31 /** 32 * GstVaapiMPEG2LevelLimits: 33 * @level: the #GstVaapiLevelMPEG2 34 * @level_idc: the MPEG-2 level indication value 35 * @horizontal_size_value: the maximum number of samples per line 36 * @vertical_size_value: the maximum number of lines per frame 37 * @frame_rate_value: the maximum number of frames per second 38 * @sample_rate: the maximum number of samples per second (for luminance) 39 * @bit_rate: the maximum bit rate (kbps) 40 * @vbv_buffer_size: the VBV buffer size requirements (bits) 41 * 42 * The data structure that describes the limits of an MPEG-2 level. 43 */ 44 typedef struct { 45 GstVaapiLevelMPEG2 level; 46 guint8 level_idc; 47 guint16 horizontal_size_value; 48 guint16 vertical_size_value; 49 guint32 frame_rate_value; 50 guint32 sample_rate; 51 guint32 bit_rate; 52 guint32 vbv_buffer_size; 53 } GstVaapiMPEG2LevelLimits; 54 55 /* Returns GstVaapiProfile from MPEG-2 profile_idc value */ 56 G_GNUC_INTERNAL 57 GstVaapiProfile 58 gst_vaapi_utils_mpeg2_get_profile (guint8 profile_idc); 59 60 /* Returns MPEG-2 profile_idc value from GstVaapiProfile */ 61 G_GNUC_INTERNAL 62 guint8 63 gst_vaapi_utils_mpeg2_get_profile_idc (GstVaapiProfile profile); 64 65 /* Returns GstVaapiLevelMPEG2 from MPEG-2 level_idc value */ 66 G_GNUC_INTERNAL 67 GstVaapiLevelMPEG2 68 gst_vaapi_utils_mpeg2_get_level (guint8 level_idc); 69 70 /* Returns MPEG-2 level_idc value from GstVaapiLevelMPEG2 */ 71 G_GNUC_INTERNAL 72 guint8 73 gst_vaapi_utils_mpeg2_get_level_idc (GstVaapiLevelMPEG2 level); 74 75 /* Returns level limits as specified in Table A-1 of the MPEG-2 standard */ 76 G_GNUC_INTERNAL 77 const GstVaapiMPEG2LevelLimits * 78 gst_vaapi_utils_mpeg2_get_level_limits (GstVaapiLevelMPEG2 level); 79 80 /* Returns the Table A-1 specification */ 81 G_GNUC_INTERNAL 82 const GstVaapiMPEG2LevelLimits * 83 gst_vaapi_utils_mpeg2_get_level_limits_table (guint * out_length_ptr); 84 85 /* Returns GstVaapiChromaType from MPEG-2 chroma_format_idc value */ 86 G_GNUC_INTERNAL 87 GstVaapiChromaType 88 gst_vaapi_utils_mpeg2_get_chroma_type (guint chroma_format_idc); 89 90 /* Returns MPEG-2 chroma_format_idc value from GstVaapiChromaType */ 91 G_GNUC_INTERNAL 92 guint 93 gst_vaapi_utils_mpeg2_get_chroma_format_idc (GstVaapiChromaType chroma_type); 94 95 G_END_DECLS 96 97 #endif /* GST_VAAPI_UTILS_MPEG2_PRIV_H */ 98