Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
9ffe8ee7
Commit
9ffe8ee7
authored
Apr 11, 2012
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qdm2: simplify bitstream reader setup for some subpacket types
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
a31787ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
20 deletions
+26
-20
qdm2.c
libavcodec/qdm2.c
+26
-20
No files found.
libavcodec/qdm2.c
View file @
9ffe8ee7
...
@@ -200,8 +200,6 @@ typedef struct {
...
@@ -200,8 +200,6 @@ typedef struct {
}
QDM2Context
;
}
QDM2Context
;
static
uint8_t
empty_buffer
[
FF_INPUT_BUFFER_PADDING_SIZE
];
static
VLC
vlc_tab_level
;
static
VLC
vlc_tab_level
;
static
VLC
vlc_tab_diff
;
static
VLC
vlc_tab_diff
;
static
VLC
vlc_tab_run
;
static
VLC
vlc_tab_run
;
...
@@ -1083,13 +1081,12 @@ static void process_subpacket_9 (QDM2Context *q, QDM2SubPNode *node)
...
@@ -1083,13 +1081,12 @@ static void process_subpacket_9 (QDM2Context *q, QDM2SubPNode *node)
* @param node pointer to node with packet
* @param node pointer to node with packet
* @param length packet length in bits
* @param length packet length in bits
*/
*/
static
void
process_subpacket_10
(
QDM2Context
*
q
,
QDM2SubPNode
*
node
,
int
length
)
static
void
process_subpacket_10
(
QDM2Context
*
q
,
QDM2SubPNode
*
node
)
{
{
GetBitContext
gb
;
GetBitContext
gb
;
init_get_bits
(
&
gb
,
((
node
==
NULL
)
?
empty_buffer
:
node
->
packet
->
data
),
((
node
==
NULL
)
?
0
:
node
->
packet
->
size
*
8
));
if
(
node
)
{
init_get_bits
(
&
gb
,
node
->
packet
->
data
,
node
->
packet
->
size
*
8
);
if
(
length
!=
0
)
{
init_tone_level_dequantization
(
q
,
&
gb
);
init_tone_level_dequantization
(
q
,
&
gb
);
fill_tone_level_array
(
q
,
1
);
fill_tone_level_array
(
q
,
1
);
}
else
{
}
else
{
...
@@ -1103,13 +1100,17 @@ static void process_subpacket_10 (QDM2Context *q, QDM2SubPNode *node, int length
...
@@ -1103,13 +1100,17 @@ static void process_subpacket_10 (QDM2Context *q, QDM2SubPNode *node, int length
*
*
* @param q context
* @param q context
* @param node pointer to node with packet
* @param node pointer to node with packet
* @param length packet length in bit
*/
*/
static
void
process_subpacket_11
(
QDM2Context
*
q
,
QDM2SubPNode
*
node
,
int
length
)
static
void
process_subpacket_11
(
QDM2Context
*
q
,
QDM2SubPNode
*
node
)
{
{
GetBitContext
gb
;
GetBitContext
gb
;
int
length
=
0
;
if
(
node
)
{
length
=
node
->
packet
->
size
*
8
;
init_get_bits
(
&
gb
,
node
->
packet
->
data
,
length
);
}
init_get_bits
(
&
gb
,
((
node
==
NULL
)
?
empty_buffer
:
node
->
packet
->
data
),
((
node
==
NULL
)
?
0
:
node
->
packet
->
size
*
8
));
if
(
length
>=
32
)
{
if
(
length
>=
32
)
{
int
c
=
get_bits
(
&
gb
,
13
);
int
c
=
get_bits
(
&
gb
,
13
);
...
@@ -1129,11 +1130,16 @@ static void process_subpacket_11 (QDM2Context *q, QDM2SubPNode *node, int length
...
@@ -1129,11 +1130,16 @@ static void process_subpacket_11 (QDM2Context *q, QDM2SubPNode *node, int length
* @param node pointer to node with packet
* @param node pointer to node with packet
* @param length packet length in bits
* @param length packet length in bits
*/
*/
static
void
process_subpacket_12
(
QDM2Context
*
q
,
QDM2SubPNode
*
node
,
int
length
)
static
void
process_subpacket_12
(
QDM2Context
*
q
,
QDM2SubPNode
*
node
)
{
{
GetBitContext
gb
;
GetBitContext
gb
;
int
length
=
0
;
if
(
node
)
{
length
=
node
->
packet
->
size
*
8
;
init_get_bits
(
&
gb
,
node
->
packet
->
data
,
length
);
}
init_get_bits
(
&
gb
,
((
node
==
NULL
)
?
empty_buffer
:
node
->
packet
->
data
),
((
node
==
NULL
)
?
0
:
node
->
packet
->
size
*
8
));
synthfilt_build_sb_samples
(
q
,
&
gb
,
length
,
8
,
QDM2_SB_USED
(
q
->
sub_sampling
));
synthfilt_build_sb_samples
(
q
,
&
gb
,
length
,
8
,
QDM2_SB_USED
(
q
->
sub_sampling
));
}
}
...
@@ -1153,21 +1159,21 @@ static void process_synthesis_subpackets (QDM2Context *q, QDM2SubPNode *list)
...
@@ -1153,21 +1159,21 @@ static void process_synthesis_subpackets (QDM2Context *q, QDM2SubPNode *list)
nodes
[
1
]
=
qdm2_search_subpacket_type_in_list
(
list
,
10
);
nodes
[
1
]
=
qdm2_search_subpacket_type_in_list
(
list
,
10
);
if
(
nodes
[
1
]
!=
NULL
)
if
(
nodes
[
1
]
!=
NULL
)
process_subpacket_10
(
q
,
nodes
[
1
]
,
nodes
[
1
]
->
packet
->
size
<<
3
);
process_subpacket_10
(
q
,
nodes
[
1
]);
else
else
process_subpacket_10
(
q
,
NULL
,
0
);
process_subpacket_10
(
q
,
NULL
);
nodes
[
2
]
=
qdm2_search_subpacket_type_in_list
(
list
,
11
);
nodes
[
2
]
=
qdm2_search_subpacket_type_in_list
(
list
,
11
);
if
(
nodes
[
0
]
!=
NULL
&&
nodes
[
1
]
!=
NULL
&&
nodes
[
2
]
!=
NULL
)
if
(
nodes
[
0
]
!=
NULL
&&
nodes
[
1
]
!=
NULL
&&
nodes
[
2
]
!=
NULL
)
process_subpacket_11
(
q
,
nodes
[
2
]
,
(
nodes
[
2
]
->
packet
->
size
<<
3
)
);
process_subpacket_11
(
q
,
nodes
[
2
]);
else
else
process_subpacket_11
(
q
,
NULL
,
0
);
process_subpacket_11
(
q
,
NULL
);
nodes
[
3
]
=
qdm2_search_subpacket_type_in_list
(
list
,
12
);
nodes
[
3
]
=
qdm2_search_subpacket_type_in_list
(
list
,
12
);
if
(
nodes
[
0
]
!=
NULL
&&
nodes
[
1
]
!=
NULL
&&
nodes
[
3
]
!=
NULL
)
if
(
nodes
[
0
]
!=
NULL
&&
nodes
[
1
]
!=
NULL
&&
nodes
[
3
]
!=
NULL
)
process_subpacket_12
(
q
,
nodes
[
3
]
,
(
nodes
[
3
]
->
packet
->
size
<<
3
)
);
process_subpacket_12
(
q
,
nodes
[
3
]);
else
else
process_subpacket_12
(
q
,
NULL
,
0
);
process_subpacket_12
(
q
,
NULL
);
}
}
...
@@ -1289,9 +1295,9 @@ static void qdm2_decode_super_block (QDM2Context *q)
...
@@ -1289,9 +1295,9 @@ static void qdm2_decode_super_block (QDM2Context *q)
process_synthesis_subpackets
(
q
,
q
->
sub_packet_list_D
);
process_synthesis_subpackets
(
q
,
q
->
sub_packet_list_D
);
q
->
do_synth_filter
=
1
;
q
->
do_synth_filter
=
1
;
}
else
if
(
q
->
do_synth_filter
)
{
}
else
if
(
q
->
do_synth_filter
)
{
process_subpacket_10
(
q
,
NULL
,
0
);
process_subpacket_10
(
q
,
NULL
);
process_subpacket_11
(
q
,
NULL
,
0
);
process_subpacket_11
(
q
,
NULL
);
process_subpacket_12
(
q
,
NULL
,
0
);
process_subpacket_12
(
q
,
NULL
);
}
}
/* **************************************************************** */
/* **************************************************************** */
}
}
...
...
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