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
aefdb735
Commit
aefdb735
authored
Oct 18, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atrac3: simplify some loop indexing
parent
e55d5390
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
30 deletions
+30
-30
atrac3.c
libavcodec/atrac3.c
+30
-30
No files found.
libavcodec/atrac3.c
View file @
aefdb735
...
...
@@ -551,7 +551,7 @@ static void reverse_matrixing(float *su1, float *su2, int *prev_code,
for
(
i
=
0
,
band
=
0
;
band
<
4
*
256
;
band
+=
256
,
i
++
)
{
int
s1
=
prev_code
[
i
];
int
s2
=
curr_code
[
i
];
nsample
=
0
;
nsample
=
band
;
if
(
s1
!=
s2
)
{
/* Selector value changed, interpolation needed. */
...
...
@@ -561,41 +561,41 @@ static void reverse_matrixing(float *su1, float *su2, int *prev_code,
mc2_r
=
matrix_coeffs
[
s2
*
2
+
1
];
/* Interpolation is done over the first eight samples. */
for
(;
nsample
<
8
;
nsample
++
)
{
float
c1
=
su1
[
band
+
nsample
];
float
c2
=
su2
[
band
+
nsample
];
c2
=
c1
*
INTERPOLATE
(
mc1_l
,
mc2_l
,
nsample
)
+
c2
*
INTERPOLATE
(
mc1_r
,
mc2_r
,
nsample
);
su1
[
band
+
nsample
]
=
c2
;
su2
[
band
+
nsample
]
=
c1
*
2
.
0
-
c2
;
for
(;
nsample
<
band
+
8
;
nsample
++
)
{
float
c1
=
su1
[
nsample
];
float
c2
=
su2
[
nsample
];
c2
=
c1
*
INTERPOLATE
(
mc1_l
,
mc2_l
,
nsample
-
band
)
+
c2
*
INTERPOLATE
(
mc1_r
,
mc2_r
,
nsample
-
band
);
su1
[
nsample
]
=
c2
;
su2
[
nsample
]
=
c1
*
2
.
0
-
c2
;
}
}
/* Apply the matrix without interpolation. */
switch
(
s2
)
{
case
0
:
/* M/S decoding */
for
(;
nsample
<
256
;
nsample
++
)
{
float
c1
=
su1
[
band
+
nsample
];
float
c2
=
su2
[
band
+
nsample
];
su1
[
band
+
nsample
]
=
c2
*
2
.
0
;
su2
[
band
+
nsample
]
=
(
c1
-
c2
)
*
2
.
0
;
for
(;
nsample
<
band
+
256
;
nsample
++
)
{
float
c1
=
su1
[
nsample
];
float
c2
=
su2
[
nsample
];
su1
[
nsample
]
=
c2
*
2
.
0
;
su2
[
nsample
]
=
(
c1
-
c2
)
*
2
.
0
;
}
break
;
case
1
:
for
(;
nsample
<
256
;
nsample
++
)
{
float
c1
=
su1
[
band
+
nsample
];
float
c2
=
su2
[
band
+
nsample
];
su1
[
band
+
nsample
]
=
(
c1
+
c2
)
*
2
.
0
;
su2
[
band
+
nsample
]
=
c2
*
-
2
.
0
;
for
(;
nsample
<
band
+
256
;
nsample
++
)
{
float
c1
=
su1
[
nsample
];
float
c2
=
su2
[
nsample
];
su1
[
nsample
]
=
(
c1
+
c2
)
*
2
.
0
;
su2
[
nsample
]
=
c2
*
-
2
.
0
;
}
break
;
case
2
:
case
3
:
for
(;
nsample
<
256
;
nsample
++
)
{
float
c1
=
su1
[
band
+
nsample
];
float
c2
=
su2
[
band
+
nsample
];
su1
[
band
+
nsample
]
=
c1
+
c2
;
su2
[
band
+
nsample
]
=
c1
-
c2
;
for
(;
nsample
<
band
+
256
;
nsample
++
)
{
float
c1
=
su1
[
nsample
];
float
c2
=
su2
[
nsample
];
su1
[
nsample
]
=
c1
+
c2
;
su2
[
nsample
]
=
c1
-
c2
;
}
break
;
default:
...
...
@@ -627,14 +627,14 @@ static void channel_weighting(float *su1, float *su2, int *p3)
get_channel_weights
(
p3
[
1
],
p3
[
0
],
w
[
0
]);
get_channel_weights
(
p3
[
3
],
p3
[
2
],
w
[
1
]);
for
(
band
=
1
;
band
<
4
;
band
++
)
{
for
(
nsample
=
0
;
nsample
<
8
;
nsample
++
)
{
su1
[
band
*
256
+
nsample
]
*=
INTERPOLATE
(
w
[
0
][
0
],
w
[
0
][
1
],
nsample
);
su2
[
band
*
256
+
nsample
]
*=
INTERPOLATE
(
w
[
1
][
0
],
w
[
1
][
1
],
nsample
);
for
(
band
=
256
;
band
<
4
*
256
;
band
+=
256
)
{
for
(
nsample
=
band
;
nsample
<
band
+
8
;
nsample
++
)
{
su1
[
nsample
]
*=
INTERPOLATE
(
w
[
0
][
0
],
w
[
0
][
1
],
nsample
-
band
);
su2
[
nsample
]
*=
INTERPOLATE
(
w
[
1
][
0
],
w
[
1
][
1
],
nsample
-
band
);
}
for
(;
nsample
<
256
;
nsample
++
)
{
su1
[
band
*
256
+
nsample
]
*=
w
[
1
][
0
];
su2
[
band
*
256
+
nsample
]
*=
w
[
1
][
1
];
for
(;
nsample
<
band
+
256
;
nsample
++
)
{
su1
[
nsample
]
*=
w
[
1
][
0
];
su2
[
nsample
]
*=
w
[
1
][
1
];
}
}
}
...
...
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