Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
0de73a46
Commit
0de73a46
authored
17 years ago
by
Justin Ruggles
Browse files
Options
Downloads
Patches
Plain Diff
fix the 256-point MDCT
Originally committed as revision 9685 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
623b7943
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/ac3dec.c
+45
-50
45 additions, 50 deletions
libavcodec/ac3dec.c
with
45 additions
and
50 deletions
libavcodec/ac3dec.c
+
45
−
50
View file @
0de73a46
...
@@ -85,8 +85,6 @@ static const float clevs[4] = { LEVEL_MINUS_3DB, LEVEL_MINUS_4POINT5DB,
...
@@ -85,8 +85,6 @@ static const float clevs[4] = { LEVEL_MINUS_3DB, LEVEL_MINUS_4POINT5DB,
static
const
float
slevs
[
4
]
=
{
LEVEL_MINUS_3DB
,
LEVEL_MINUS_6DB
,
LEVEL_ZERO
,
LEVEL_MINUS_6DB
};
static
const
float
slevs
[
4
]
=
{
LEVEL_MINUS_3DB
,
LEVEL_MINUS_6DB
,
LEVEL_ZERO
,
LEVEL_MINUS_6DB
};
#define N 512
/* constant for IMDCT Block size */
#define BLOCK_SIZE 256
#define BLOCK_SIZE 256
/* Output and input configurations. */
/* Output and input configurations. */
...
@@ -1379,66 +1377,63 @@ static void do_downmix(AC3DecodeContext *ctx)
...
@@ -1379,66 +1377,63 @@ static void do_downmix(AC3DecodeContext *ctx)
*/
*/
static
void
do_imdct_256
(
AC3DecodeContext
*
ctx
,
int
chindex
)
static
void
do_imdct_256
(
AC3DecodeContext
*
ctx
,
int
chindex
)
{
{
int
k
;
int
i
,
k
;
float
x1
[
128
],
x2
[
128
];
float
x
[
128
];
float
*
o_ptr
,
*
d_ptr
,
*
w
;
FFTComplex
z
[
2
][
64
];
FFTComplex
*
ptr1
,
*
ptr2
;
float
*
o_ptr
=
ctx
->
tmp_output
;
for
(
k
=
0
;
k
<
N
/
4
;
k
++
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
x1
[
k
]
=
ctx
->
transform_coeffs
[
chindex
][
2
*
k
];
/* de-interleave coefficients */
x2
[
k
]
=
ctx
->
transform_coeffs
[
chindex
][
2
*
k
+
1
];
for
(
k
=
0
;
k
<
128
;
k
++
)
{
}
x
[
k
]
=
ctx
->
transform_coeffs
[
chindex
][
2
*
k
+
i
];
}
ctx
->
imdct_256
.
fft
.
imdct_calc
(
&
ctx
->
imdct_256
,
ctx
->
tmp_output
,
x1
,
ctx
->
tmp_imdct
);
/* run standard IMDCT */
ctx
->
imdct_256
.
fft
.
imdct_calc
(
&
ctx
->
imdct_256
,
ctx
->
tmp_output
+
256
,
x2
,
ctx
->
tmp_imdct
);
ctx
->
imdct_256
.
fft
.
imdct_calc
(
&
ctx
->
imdct_256
,
o_ptr
,
x
,
ctx
->
tmp_imdct
);
o_ptr
=
ctx
->
output
[
chindex
];
/* reverse the post-rotation & reordering from standard IMDCT */
d_ptr
=
ctx
->
delay
[
chindex
];
for
(
k
=
0
;
k
<
32
;
k
++
)
{
ptr1
=
(
FFTComplex
*
)
ctx
->
tmp_output
;
z
[
i
][
32
+
k
].
re
=
-
o_ptr
[
128
+
2
*
k
];
ptr2
=
(
FFTComplex
*
)
ctx
->
tmp_output
+
256
;
z
[
i
][
32
+
k
].
im
=
-
o_ptr
[
2
*
k
];
w
=
ctx
->
window
;
z
[
i
][
31
-
k
].
re
=
o_ptr
[
2
*
k
+
1
];
z
[
i
][
31
-
k
].
im
=
o_ptr
[
128
+
2
*
k
+
1
];
for
(
k
=
0
;
k
<
N
/
8
;
k
++
)
}
{
o_ptr
[
2
*
k
]
=
-
ptr1
[
k
].
im
*
w
[
2
*
k
]
+
d_ptr
[
2
*
k
]
+
384
.
0
;
o_ptr
[
2
*
k
+
1
]
=
ptr1
[
N
/
8
-
k
-
1
].
re
*
w
[
2
*
k
+
1
]
+
384
.
0
;
o_ptr
[
N
/
4
+
2
*
k
]
=
-
ptr1
[
k
].
re
*
w
[
N
/
4
+
2
*
k
]
+
d_ptr
[
N
/
4
+
2
*
k
]
+
384
.
0
;
o_ptr
[
N
/
4
+
2
*
k
+
1
]
=
ptr1
[
N
/
8
-
k
-
1
].
im
*
w
[
N
/
4
+
2
*
k
+
1
]
+
d_ptr
[
N
/
4
+
2
*
k
+
1
]
+
384
.
0
;
d_ptr
[
2
*
k
]
=
ptr2
[
k
].
re
*
w
[
k
/
2
-
2
*
k
-
1
];
d_ptr
[
2
*
k
+
1
]
=
-
ptr2
[
N
/
8
-
k
-
1
].
im
*
w
[
N
/
2
-
2
*
k
-
2
];
d_ptr
[
N
/
4
+
2
*
k
]
=
ptr2
[
k
].
im
*
w
[
N
/
4
-
2
*
k
-
1
];
d_ptr
[
N
/
4
+
2
*
k
+
1
]
=
-
ptr2
[
N
/
8
-
k
-
1
].
re
*
w
[
N
/
4
-
2
*
k
-
2
];
}
}
}
/* This function performs the imdct on 512 sample transform
/* apply AC-3 post-rotation & reordering */
* coefficients.
for
(
k
=
0
;
k
<
64
;
k
++
)
{
*/
o_ptr
[
2
*
k
]
=
-
z
[
0
][
k
].
im
;
static
void
do_imdct_512
(
AC3DecodeContext
*
ctx
,
int
chindex
)
o_ptr
[
2
*
k
+
1
]
=
z
[
0
][
63
-
k
].
re
;
{
o_ptr
[
128
+
2
*
k
]
=
-
z
[
0
][
k
].
re
;
float
*
ptr
;
o_ptr
[
128
+
2
*
k
+
1
]
=
z
[
0
][
63
-
k
].
im
;
o_ptr
[
256
+
2
*
k
]
=
-
z
[
1
][
k
].
re
;
ctx
->
imdct_512
.
fft
.
imdct_calc
(
&
ctx
->
imdct_512
,
ctx
->
tmp_output
,
o_ptr
[
256
+
2
*
k
+
1
]
=
z
[
1
][
63
-
k
].
im
;
ctx
->
transform_coeffs
[
chindex
],
ctx
->
tmp_imdct
);
o_ptr
[
384
+
2
*
k
]
=
z
[
1
][
k
].
im
;
ptr
=
ctx
->
output
[
chindex
];
o_ptr
[
384
+
2
*
k
+
1
]
=
-
z
[
1
][
63
-
k
].
re
;
ctx
->
dsp
.
vector_fmul_add_add
(
ptr
,
ctx
->
tmp_output
,
ctx
->
window
,
ctx
->
delay
[
chindex
],
384
,
BLOCK_SIZE
,
1
);
}
ptr
=
ctx
->
delay
[
chindex
];
ctx
->
dsp
.
vector_fmul_reverse
(
ptr
,
ctx
->
tmp_output
+
256
,
ctx
->
window
,
BLOCK_SIZE
);
}
}
/* IMDCT Transform. */
/* IMDCT Transform. */
static
inline
void
do_imdct
(
AC3DecodeContext
*
ctx
)
static
inline
void
do_imdct
(
AC3DecodeContext
*
ctx
)
{
{
int
i
;
int
ch
;
if
(
ctx
->
blkoutput
&
AC3_OUTPUT_LFEON
)
{
if
(
ctx
->
blkoutput
&
AC3_OUTPUT_LFEON
)
{
do_imdct_512
(
ctx
,
0
);
ctx
->
imdct_512
.
fft
.
imdct_calc
(
&
ctx
->
imdct_512
,
ctx
->
tmp_output
,
ctx
->
transform_coeffs
[
0
],
ctx
->
tmp_imdct
);
}
}
for
(
i
=
0
;
i
<
ctx
->
nfchans
;
i
++
)
{
for
(
ch
=
1
;
ch
<=
ctx
->
nfchans
;
ch
++
)
{
if
((
ctx
->
blksw
>>
i
)
&
1
)
if
((
ctx
->
blksw
>>
(
ch
-
1
)
)
&
1
)
do_imdct_256
(
ctx
,
i
+
1
);
do_imdct_256
(
ctx
,
ch
);
else
else
do_imdct_512
(
ctx
,
i
+
1
);
ctx
->
imdct_512
.
fft
.
imdct_calc
(
&
ctx
->
imdct_512
,
ctx
->
tmp_output
,
ctx
->
transform_coeffs
[
ch
],
ctx
->
tmp_imdct
);
ctx
->
dsp
.
vector_fmul_add_add
(
ctx
->
output
[
ch
],
ctx
->
tmp_output
,
ctx
->
window
,
ctx
->
delay
[
ch
],
384
,
256
,
1
);
ctx
->
dsp
.
vector_fmul_reverse
(
ctx
->
delay
[
ch
],
ctx
->
tmp_output
+
256
,
ctx
->
window
,
256
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment