Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
31c57185
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
31c57185
编写于
8月 21, 2009
作者:
S
Sascha Sommer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add some more wmapro decoder hunks
Originally committed as revision 19678 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
7056883b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
88 addition
and
5 deletion
+88
-5
libavcodec/wmaprodec.c
libavcodec/wmaprodec.c
+88
-5
未找到文件。
libavcodec/wmaprodec.c
浏览文件 @
31c57185
/*
* Wmapro compatible decoder
* Copyright (c) 2007 Baptiste Coudurier, Benjamin Larsson, Ulion
* Copyright (c) 2008 - 2009 Sascha Sommer, Benjamin Larsson
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file libavcodec/wmaprodec.c
* @brief wmapro decoder implementation
* Wmapro is an MDCT based codec comparable to wma standard or AAC.
* The decoding therefore consists of the following steps:
* - bitstream decoding
* - reconstruction of per-channel data
* - rescaling and inverse quantization
* - IMDCT
* - windowing and overlapp-add
*
* The compressed wmapro bitstream is split into individual packets.
* Every such packet contains one or more wma frames.
* The compressed frames may have a variable length and frames may
* cross packet boundaries.
* Common to all wmapro frames is the number of samples that are stored in
* a frame.
* The number of samples and a few other decode flags are stored
* as extradata that has to be passed to the decoder.
*
* The wmapro frames themselves are again split into a variable number of
* subframes. Every subframe contains the data for 2^N time domain samples
* where N varies between 7 and 12.
*
* Example wmapro bitstream (in samples):
*
* || packet 0 || packet 1 || packet 2 packets
* ---------------------------------------------------
* || frame 0 || frame 1 || frame 2 || frames
* ---------------------------------------------------
* || | | || | | | || || subframes of channel 0
* ---------------------------------------------------
* || | | || | | | || || subframes of channel 1
* ---------------------------------------------------
*
* The frame layouts for the individual channels of a wma frame does not need
* to be the same.
*
* However, if the offsets and lengths of several subframes of a frame are the
* same, the subframes of the channels can be grouped.
* Every group may then use special coding techniques like M/S stereo coding
* to improve the compression ratio. These channel transformations do not
* need to be applied to a whole subframe. Instead, they can also work on
* individual scale factor bands (see below).
* The coefficients that carry the audio signal in the frequency domain
* are transmitted as huffman-coded vectors with 4, 2 and 1 elements.
* In addition to that, the encoder can switch to a runlevel coding scheme
* by transmitting subframe_length / 128 zero coefficients.
*
* Before the audio signal can be converted to the time domain, the
* coefficients have to be rescaled and inverse quantized.
* A subframe is therefore split into several scale factor bands that get
* scaled individually.
* Scale factors are submitted for every frame but they might be shared
* between the subframes of a channel. Scale factors are initially DPCM-coded.
* Once scale factors are shared, the differences are transmitted as runlevel
* codes.
* Every subframe length and offset combination in the frame layout shares a
* common quantization factor that can be adjusted for every channel by a
* modifier.
* After the inverse quantization, the coefficients get processed by an IMDCT.
* The resulting values are then windowed with a sine window and the first half
* of the values are added to the second half of the output from the previous
* subframe in order to reconstruct the output samples.
*/
/**
*@brief Uninitialize the decoder and free all resources.
*@param avctx codec context
...
...
@@ -8,11 +96,6 @@ static av_cold int decode_end(AVCodecContext *avctx)
WMA3DecodeContext
*
s
=
avctx
->
priv_data
;
int
i
;
av_freep
(
&
s
->
num_sfb
);
av_freep
(
&
s
->
sfb_offsets
);
av_freep
(
&
s
->
subwoofer_cutoffs
);
av_freep
(
&
s
->
sf_offsets
);
for
(
i
=
0
;
i
<
WMAPRO_BLOCK_SIZES
;
i
++
)
ff_mdct_end
(
&
s
->
mdct_ctx
[
i
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录