Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
ece6cca1
Commit
ece6cca1
authored
Feb 14, 2011
by
Young Han Lee
Committed by
Michael Niedermayer
Feb 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aacdec: Implement LTP support.
Ported from gsoc svn. (cherry picked from commit
ead15f1d
)
parent
d3c4829a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
178 additions
and
20 deletions
+178
-20
aac.h
libavcodec/aac.h
+23
-9
aacdec.c
libavcodec/aacdec.c
+146
-10
aacdectab.h
libavcodec/aacdectab.h
+8
-0
mpeg4audio.h
libavcodec/mpeg4audio.h
+1
-1
No files found.
libavcodec/aac.h
View file @
ece6cca1
...
...
@@ -43,6 +43,7 @@
#define MAX_ELEM_ID 16
#define TNS_MAX_ORDER 20
#define MAX_LTP_LONG_SFB 40
enum
RawDataBlockType
{
TYPE_SCE
,
...
...
@@ -130,6 +131,16 @@ typedef struct {
#define SCALE_MAX_DIFF 60 ///< maximum scalefactor difference allowed by standard
#define SCALE_DIFF_ZERO 60 ///< codebook index corresponding to zero scalefactor indices difference
/**
* Long Term Prediction
*/
typedef
struct
{
int8_t
present
;
int16_t
lag
;
float
coef
;
int8_t
used
[
MAX_LTP_LONG_SFB
];
}
LongTermPrediction
;
/**
* Individual Channel Stream
*/
...
...
@@ -139,6 +150,7 @@ typedef struct {
uint8_t
use_kb_window
[
2
];
///< If set, use Kaiser-Bessel window, otherwise use a sinus window.
int
num_window_groups
;
uint8_t
group_len
[
8
];
LongTermPrediction
ltp
;
const
uint16_t
*
swb_offset
;
///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window
const
uint8_t
*
swb_sizes
;
///< table of scalefactor band sizes for a particular window
int
num_swb
;
///< number of scalefactor window bands
...
...
@@ -206,14 +218,15 @@ typedef struct {
IndividualChannelStream
ics
;
TemporalNoiseShaping
tns
;
Pulse
pulse
;
enum
BandType
band_type
[
128
];
///< band types
int
band_type_run_end
[
120
];
///< band type run end points
float
sf
[
120
];
///< scalefactors
int
sf_idx
[
128
];
///< scalefactor indices (used by encoder)
uint8_t
zeroes
[
128
];
///< band is not coded (used by encoder)
DECLARE_ALIGNED
(
16
,
float
,
coeffs
)[
1024
];
///< coefficients for IMDCT
DECLARE_ALIGNED
(
16
,
float
,
saved
)[
1024
];
///< overlap
DECLARE_ALIGNED
(
16
,
float
,
ret
)[
2048
];
///< PCM output
enum
BandType
band_type
[
128
];
///< band types
int
band_type_run_end
[
120
];
///< band type run end points
float
sf
[
120
];
///< scalefactors
int
sf_idx
[
128
];
///< scalefactor indices (used by encoder)
uint8_t
zeroes
[
128
];
///< band is not coded (used by encoder)
DECLARE_ALIGNED
(
16
,
float
,
coeffs
)[
1024
];
///< coefficients for IMDCT
DECLARE_ALIGNED
(
16
,
float
,
saved
)[
1024
];
///< overlap
DECLARE_ALIGNED
(
16
,
float
,
ret
)[
2048
];
///< PCM output
DECLARE_ALIGNED
(
16
,
int16_t
,
ltp_state
)[
3072
];
///< time signal for LTP
PredictorState
predictor_state
[
MAX_PREDICTORS
];
}
SingleChannelElement
;
...
...
@@ -259,7 +272,7 @@ typedef struct {
* @defgroup temporary aligned temporary buffers (We do not want to have these on the stack.)
* @{
*/
DECLARE_ALIGNED
(
16
,
float
,
buf_mdct
)[
1024
];
DECLARE_ALIGNED
(
16
,
float
,
buf_mdct
)[
2048
];
/** @} */
/**
...
...
@@ -268,6 +281,7 @@ typedef struct {
*/
FFTContext
mdct
;
FFTContext
mdct_small
;
FFTContext
mdct_ltp
;
DSPContext
dsp
;
FmtConvertContext
fmt_conv
;
int
random_state
;
...
...
libavcodec/aacdec.c
View file @
ece6cca1
This diff is collapsed.
Click to expand it.
libavcodec/aacdectab.h
View file @
ece6cca1
...
...
@@ -35,6 +35,14 @@
#include <stdint.h>
/* @name ltp_coef
* Table of the LTP coefficient (multiplied by 2)
*/
static
const
float
ltp_coef
[
8
]
=
{
1
.
141658
,
1
.
393232
,
1
.
626008
,
1
.
822608
,
1
.
969800
,
2
.
135788
,
2
.
2389202
,
2
.
739066
,
};
/* @name tns_tmp2_map
* Tables of the tmp2[] arrays of LPC coefficients used for TNS.
* The suffix _M_N[] indicate the values of coef_compress and coef_res
...
...
libavcodec/mpeg4audio.h
View file @
ece6cca1
...
...
@@ -57,7 +57,7 @@ enum AudioObjectType {
AOT_AAC_MAIN
,
///< Y Main
AOT_AAC_LC
,
///< Y Low Complexity
AOT_AAC_SSR
,
///< N (code in SoC repo) Scalable Sample Rate
AOT_AAC_LTP
,
///<
N (code in SoC repo)
Long Term Prediction
AOT_AAC_LTP
,
///<
Y
Long Term Prediction
AOT_SBR
,
///< Y Spectral Band Replication
AOT_AAC_SCALABLE
,
///< N Scalable
AOT_TWINVQ
,
///< N Twin Vector Quantizer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment