Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tristan Matthews
bitstream
Commits
6a24dfe2
Commit
6a24dfe2
authored
Sep 12, 2018
by
Christophe Massiot
Browse files
mpga: add mpga_sync_compare_formats_free
parent
b6bf2674
Changes
1
Hide whitespace changes
Inline
Side-by-side
mpeg/mpga.h
View file @
6a24dfe2
...
...
@@ -228,6 +228,23 @@ static inline bool mpga_sync_compare_formats(const uint8_t *p_mpga1, const uint8
return
i_mode1
==
i_mode2
;
}
/* same but without comparing bitrate (free bitrate) */
static
inline
bool
mpga_sync_compare_formats_free
(
const
uint8_t
*
p_mpga1
,
const
uint8_t
*
p_mpga2
)
{
if
(
!
(
p_mpga1
[
0
]
==
p_mpga2
[
0
]
&&
(
p_mpga1
[
1
]
&
0xfe
)
==
(
p_mpga2
[
1
]
&
0xfe
)
&&
(
p_mpga1
[
2
]
&
0xc
)
==
(
p_mpga2
[
2
]
&
0xc
)))
return
false
;
/* consider stereo and joint stereo the same - because encoders can
* switch on the fly */
uint8_t
i_mode1
=
mpga_get_mode
(
p_mpga1
);
uint8_t
i_mode2
=
mpga_get_mode
(
p_mpga2
);
if
(
i_mode1
==
MPGA_MODE_JOINT
)
i_mode1
=
MPGA_MODE_STEREO
;
if
(
i_mode2
==
MPGA_MODE_JOINT
)
i_mode2
=
MPGA_MODE_STEREO
;
return
i_mode1
==
i_mode2
;
}
#ifdef __cplusplus
}
#endif
...
...
Write
Preview
Supports
Markdown
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