FFmpeg的HEVC解码器源代码学习笔记-3

简介:

使用FFmpeg对HEVC码流进行解码时,所采用的各种结构体的介绍:

AVCodec

cpp 复制代码
typedef struct AVCodec {
    /**
     * Name of the codec implementation.
     * The name is globally unique among encoders and among decoders (but an
     * encoder and a decoder can share the same name).
     * This is the primary way to find a codec from the user perspective.
     */
    const char *name; //编码器名称,编解码器实现的名称。
    // 该名称在编码器和解码器之间是全局唯一的(但编码器和解码器可以共享相同的名称)。
    // 这是从用户角度查找编解码器的主要方法。
    /**
     * Descriptive name for the codec, meant to be more human readable than name.
     * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
     */
    const char *long_name; //编解码器的描述性名称,比名称更易于理解。
    enum AVMediaType type; // 媒体类型,例如视频还是音频
    enum AVCodecID id; // 视频编码器的ID
    /**
     * Codec capabilities.
     * see AV_CODEC_CAP_*
     */
    int capabilities; // 
    uint8_t max_lowres;                     ///解码器支持的低分辨率最大值 < maximum value for lowres supported by the decoder 
    const AVRational *supported_framerates; ///支持的帧率,由数组形式表现,其中每个AVRational为{num,den}分别为分子和分母,以此来表示帧率< array of supported framerates, or NULL if any, array is terminated by {0,0}
    const enum AVPixelFormat *pix_fmts;     ///支持的像素格式,由数组形式表示,枚举了每种类型,可以参考libavutil/pixfmt.h里面的枚举定义enum AVPixelFormat{} < array of supported pixel formats, or NULL if unknown, array is terminated by -1
    const int *supported_samplerates;       ///音频相关,为音频的采样频率< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
    const enum AVSampleFormat *sample_fmts; ///音频相关,为音频的采样格式,例如24点位< array of supported sample formats, or NULL if unknown, array is terminated by -1
#if FF_API_OLD_CHANNEL_LAYOUT
    /**
     * @deprecated use ch_layouts instead
     */
    attribute_deprecated
    const uint64_t *channel_layouts;         ///音频相关,支持的音频通道布局< array of support channel layouts, or NULL if unknown. array is terminated by 0
#endif
    const AVClass *priv_class;              ///指向特定解码器的上下文环境< AVClass for the private context
    const AVProfile *profiles;              ///指向当前解码的配置文件类型,例如main,main10等< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN}

    /**
     * Group name of the codec implementation.
     * This is a short symbolic name of the wrapper backing this codec. A
     * wrapper uses some kind of external implementation for the codec, such
     * as an external library, or a codec implementation provided by the OS or
     * the hardware.
     * If this field is NULL, this is a builtin, libavcodec native codec.
     * If non-NULL, this will be the suffix in AVCodec.name in most cases
     * (usually AVCodec.name will be of the form "<codec_name>_<wrapper_name>").
     */
    const char *wrapper_name;

    /**
     * Array of supported channel layouts, terminated with a zeroed layout.
     */
    const AVChannelLayout *ch_layouts;
} AVCodec;

为了弄清楚这个结构体每个变量的作用,以及在解码过程中的实际值,我将HEVC解码过程中的codec变量打印出来,里面每个变量如下:

codec->priv_class

codec->profiles

AVCodecParserContext定义的变量parser

AVCodeContext定义的变量C如下:

AVFrame frame

相关推荐
BeyondESH41 分钟前
Linux线程同步—竞态条件和互斥锁(C语言)
linux·服务器·c++
青椒大仙KI111 小时前
24/9/19 算法笔记 kaggle BankChurn数据分类
笔记·算法·分类
豆浩宇1 小时前
Halcon OCR检测 免训练版
c++·人工智能·opencv·算法·计算机视觉·ocr
WG_171 小时前
C++多态
开发语言·c++·面试
liangbm31 小时前
数学建模笔记——动态规划
笔记·python·算法·数学建模·动态规划·背包问题·优化问题
潮汐退涨月冷风霜2 小时前
机器学习之非监督学习(四)K-means 聚类算法
学习·算法·机器学习
GoppViper2 小时前
golang学习笔记29——golang 中如何将 GitHub 最新提交的版本设置为 v1.0.0
笔记·git·后端·学习·golang·github·源代码管理
羊小猪~~2 小时前
深度学习基础案例5--VGG16人脸识别(体验学习的痛苦与乐趣)
人工智能·python·深度学习·学习·算法·机器学习·cnn
Charles Ray3 小时前
C++学习笔记 —— 内存分配 new
c++·笔记·学习
重生之我在20年代敲代码3 小时前
strncpy函数的使用和模拟实现
c语言·开发语言·c++·经验分享·笔记