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

相关推荐
m0_678693335 分钟前
深度学习笔记29-RNN实现阿尔茨海默病诊断(Pytorch)
笔记·rnn·深度学习
每次的天空13 分钟前
Android-自定义View的实战学习总结
android·学习·kotlin·音视频
重庆小透明19 分钟前
力扣刷题记录【1】146.LRU缓存
java·后端·学习·算法·leetcode·缓存
sigmoidAndRELU1 小时前
读Vista
笔记·stable diffusion·世界模型
小小小小王王王2 小时前
求猪肉价格最大值
数据结构·c++·算法
Sincerelyplz2 小时前
【Temproal】快速了解Temproal的核心概念以及使用
笔记·后端·开源
岁忧2 小时前
(LeetCode 面试经典 150 题 ) 58. 最后一个单词的长度 (字符串)
java·c++·算法·leetcode·面试·go
许白掰2 小时前
【stm32】HAL库开发——CubeMX配置RTC,单片机工作模式和看门狗
stm32·单片机·嵌入式硬件·学习·实时音视频
future14123 小时前
C#学习日记
开发语言·学习·c#
码农编程录3 小时前
【c/c++3】类和对象,vector容器,类继承和多态,systemd,std&boost
c++