Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
e0f38966
Commit
e0f38966
authored
Dec 19, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AES3: decode to S32N rather than S24 and simplify a little
parent
1d5cbf26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
50 deletions
+23
-50
modules/codec/aes3.c
modules/codec/aes3.c
+23
-50
No files found.
modules/codec/aes3.c
View file @
e0f38966
...
...
@@ -157,32 +157,19 @@ static block_t *Decode( decoder_t *p_dec, block_t **pp_block )
p_block
->
i_buffer
-=
AES3_HEADER_LEN
;
p_block
->
p_buffer
+=
AES3_HEADER_LEN
;
#ifdef WORDS_BIGENGIAN
# define LOB 2
# define HIB 0
#else
# define LOB 0
# define HIB 2
#endif
#define MIB 1
if
(
i_bits
==
24
)
{
uint
8_t
*
p_out
=
p_aout_buffer
->
p_buffer
;
uint
32_t
*
p_out
=
(
uint32_t
*
)
p_aout_buffer
->
p_buffer
;
while
(
p_block
->
i_buffer
/
7
)
{
p_out
[
LOB
]
=
reverse
[
p_block
->
p_buffer
[
0
]];
p_out
[
MIB
]
=
reverse
[
p_block
->
p_buffer
[
1
]];
p_out
[
HIB
]
=
reverse
[
p_block
->
p_buffer
[
2
]];
p_out
+=
3
;
p_out
[
LOB
]
=
(
reverse
[
p_block
->
p_buffer
[
3
]]
>>
4
)
|
((
reverse
[
p_block
->
p_buffer
[
4
]]
<<
4
)
&
0xf0
);
p_out
[
MIB
]
=
(
reverse
[
p_block
->
p_buffer
[
4
]]
>>
4
)
|
((
reverse
[
p_block
->
p_buffer
[
5
]]
<<
4
)
&
0xf0
);
p_out
[
HIB
]
=
(
reverse
[
p_block
->
p_buffer
[
5
]]
>>
4
)
|
((
reverse
[
p_block
->
p_buffer
[
6
]]
<<
4
)
&
0xf0
);
p_out
+=
3
;
*
(
p_out
++
)
=
(
reverse
[
p_block
->
p_buffer
[
0
]]
<<
8
)
|
(
reverse
[
p_block
->
p_buffer
[
1
]]
<<
16
)
|
(
reverse
[
p_block
->
p_buffer
[
2
]]
<<
24
);
*
(
p_out
++
)
=
((
reverse
[
p_block
->
p_buffer
[
3
]]
<<
4
)
|
(
reverse
[
p_block
->
p_buffer
[
4
]]
<<
12
)
|
(
reverse
[
p_block
->
p_buffer
[
5
]]
<<
20
)
|
(
reverse
[
p_block
->
p_buffer
[
6
]]
<<
28
))
&
0xFFFFFF00
;
p_block
->
i_buffer
-=
7
;
p_block
->
p_buffer
+=
7
;
...
...
@@ -191,47 +178,34 @@ static block_t *Decode( decoder_t *p_dec, block_t **pp_block )
}
else
if
(
i_bits
==
20
)
{
uint
8_t
*
p_out
=
p_aout_buffer
->
p_buffer
;
uint
32_t
*
p_out
=
(
uint32_t
*
)
p_aout_buffer
->
p_buffer
;
while
(
p_block
->
i_buffer
/
6
)
{
p_out
[
LOB
]
=
((
reverse
[
p_block
->
p_buffer
[
0
]]
<<
4
)
&
0xf0
);
p_out
[
MIB
]
=
(
reverse
[
p_block
->
p_buffer
[
0
]]
>>
4
)
|
((
reverse
[
p_block
->
p_buffer
[
1
]]
<<
4
)
&
0xf0
);
p_out
[
HIB
]
=
(
reverse
[
p_block
->
p_buffer
[
1
]]
>>
4
)
|
((
reverse
[
p_block
->
p_buffer
[
2
]]
<<
4
)
&
0xf0
);
p_out
+=
3
;
p_out
[
LOB
]
=
((
reverse
[
p_block
->
p_buffer
[
3
]]
<<
4
)
&
0xf0
);
p_out
[
MIB
]
=
(
reverse
[
p_block
->
p_buffer
[
3
]]
>>
4
)
|
((
reverse
[
p_block
->
p_buffer
[
4
]]
<<
4
)
&
0xf0
);
p_out
[
HIB
]
=
(
reverse
[
p_block
->
p_buffer
[
4
]]
>>
4
)
|
((
reverse
[
p_block
->
p_buffer
[
5
]]
<<
4
)
&
0xf0
);
p_out
+=
3
;
*
(
p_out
++
)
=
(
reverse
[
p_block
->
p_buffer
[
0
]]
<<
12
)
|
(
reverse
[
p_block
->
p_buffer
[
1
]]
<<
20
)
|
(
reverse
[
p_block
->
p_buffer
[
2
]]
<<
28
);
*
(
p_out
++
)
=
(
reverse
[
p_block
->
p_buffer
[
3
]]
<<
12
)
|
(
reverse
[
p_block
->
p_buffer
[
4
]]
<<
20
)
|
(
reverse
[
p_block
->
p_buffer
[
5
]]
<<
28
);
p_block
->
i_buffer
-=
6
;
p_block
->
p_buffer
+=
6
;
}
}
#undef HIB
#define HIB (!(LOB))
else
{
uint
8_t
*
p_out
=
p_aout_buffer
->
p_buffer
;
uint
16_t
*
p_out
=
(
uint16_t
*
)
p_aout_buffer
->
p_buffer
;
assert
(
i_bits
==
16
);
while
(
p_block
->
i_buffer
/
5
)
{
p_out
[
LOB
]
=
reverse
[
p_block
->
p_buffer
[
0
]];
p_out
[
HIB
]
=
reverse
[
p_block
->
p_buffer
[
1
]];
p_out
+=
2
;
p_out
[
LOB
]
=
(
reverse
[
p_block
->
p_buffer
[
2
]]
>>
4
)
|
((
reverse
[
p_block
->
p_buffer
[
3
]]
<<
4
)
&
0xf0
);
p_out
[
HIB
]
=
(
reverse
[
p_block
->
p_buffer
[
3
]]
>>
4
)
|
((
reverse
[
p_block
->
p_buffer
[
4
]]
<<
4
)
&
0xf0
);
p_out
+=
2
;
*
(
p_out
++
)
=
reverse
[
p_block
->
p_buffer
[
0
]]
|
reverse
[
p_block
->
p_buffer
[
1
]];
*
(
p_out
++
)
=
(
reverse
[
p_block
->
p_buffer
[
2
]]
>>
4
)
|
(
reverse
[
p_block
->
p_buffer
[
3
]]
<<
4
)
|
(
reverse
[
p_block
->
p_buffer
[
4
]]
<<
12
);
p_block
->
i_buffer
-=
5
;
p_block
->
p_buffer
+=
5
;
...
...
@@ -385,9 +359,8 @@ static block_t *Parse( decoder_t *p_dec, int *pi_frame_length, int *pi_bits,
}
else
{
p_dec
->
fmt_out
.
i_codec
=
i_bits
==
16
?
VLC_CODEC_S16N
:
VLC_CODEC_S24N
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
i_bits
==
16
?
16
:
24
;
p_dec
->
fmt_out
.
i_codec
=
i_bits
==
16
?
VLC_CODEC_S16N
:
VLC_CODEC_S32N
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
i_bits
==
16
?
16
:
32
;
}
p_dec
->
fmt_out
.
audio
.
i_channels
=
i_channels
;
...
...
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