DVSDK中的AAC-LC码流分析(2):adts_variable_header()

来源:互联网 发布:thinkpad t470 知乎 编辑:程序博客网 时间:2024/06/09 14:47

快乐虾

http://blog.csdn.net/lights_joy/

欢迎转载,但请保留作者信息

 

在adts_fixed_header()之后就是这一小节了,标准中定义:

在ffmpeg中这一小节是和adts_fixed_header一起处理的,从代码中可以明显看到ffmpeg直接对copyright_identification_bit、copyright_identification_start、adts_buffer_fullness这三个定义做了丢弃处理。

这一节消耗了28bit:

0 10 1f fc

这两个头总共消耗了56bit,7个字节。

解出来的几个变量值为:

在这里frame_length指定了这一帧数据编码后的长度。而adts_buffer_fullness的值为2047,即十六进制的0x7ff,根据标准:

A value of hexadecimal 7FF signals that the bitstream is a variable rate bitstream. In this case, buffer fullness is not applicable.

在ffmpeg中,直接取number_of_raw_data_blocks_in_frame的值计算采样点数:

    hdr->frame_length = size    = get_bits(gbc, 13); /* aac_frame_length */
    hdr->number_of_raw_data_blocks_in_frame = rdb = get_bits(gbc, 2);     

    hdr->num_aac_frames = rdb + 1;

    hdr->samples        = (rdb + 1) * 1024;

    hdr->bit_rate       = size * 8 * hdr->sample_rate / hdr->samples;

 

 

 

原创粉丝点击