summaryrefslogtreecommitdiff
path: root/apps/metadata
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2009-08-14 15:13:14 +0000
committerMohamed Tarek <mt@rockbox.org>2009-08-14 15:13:14 +0000
commit466b2ae2481477a2797f785c269e0a996401597b (patch)
treefe51b38c6ccaefa904ab8fad2cecdb948af1e4bb /apps/metadata
parent0b6aa3851631eacba413d965f931f59cc8e37773 (diff)
Factor out bytestream reading functions needed in rm parsers/codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22308 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata')
-rw-r--r--apps/metadata/rm.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/apps/metadata/rm.c b/apps/metadata/rm.c
index 9e42367c58..fd6f1d984c 100644
--- a/apps/metadata/rm.c
+++ b/apps/metadata/rm.c
@@ -38,26 +38,14 @@
#define DEBUGF(...)
#endif
-#ifdef DEBUG_RM
-static uint16_t get_uint16be(uint8_t *buf)
-{
- return (uint16_t)((buf[0] << 8)|buf[1]);
-}
-
-static uint32_t get_uint32be(uint8_t *buf)
-{
- return (uint32_t)((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]);
-}
-#endif
-
static inline void print_cook_extradata(RMContext *rmctx) {
- DEBUGF(" cook_version = 0x%08lx\n", get_uint32be(rmctx->codec_extradata));
- DEBUGF(" samples_per_frame_per_channel = %d\n", get_uint16be(&rmctx->codec_extradata[4]));
- DEBUGF(" number_of_subbands_in_freq_domain = %d\n", get_uint16be(&rmctx->codec_extradata[6]));
+ DEBUGF(" cook_version = 0x%08lx\n", rm_get_uint32be(rmctx->codec_extradata));
+ DEBUGF(" samples_per_frame_per_channel = %d\n", rm_get_uint16be(&rmctx->codec_extradata[4]));
+ DEBUGF(" number_of_subbands_in_freq_domain = %d\n", rm_get_uint16be(&rmctx->codec_extradata[6]));
if(rmctx->extradata_size == 16) {
- DEBUGF(" joint_stereo_subband_start = %d\n",get_uint16be(&rmctx->codec_extradata[12]));
- DEBUGF(" joint_stereo_vlc_bits = %d\n", get_uint16be(&rmctx->codec_extradata[14]));
+ DEBUGF(" joint_stereo_subband_start = %d\n",rm_get_uint16be(&rmctx->codec_extradata[12]));
+ DEBUGF(" joint_stereo_vlc_bits = %d\n", rm_get_uint16be(&rmctx->codec_extradata[14]));
}
}