diff options
Diffstat (limited to 'apps/codecs/libcook/cook.c')
-rw-r--r-- | apps/codecs/libcook/cook.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/apps/codecs/libcook/cook.c b/apps/codecs/libcook/cook.c index 7ad994926e..74f695e627 100644 --- a/apps/codecs/libcook/cook.c +++ b/apps/codecs/libcook/cook.c | |||
@@ -721,27 +721,17 @@ static void dump_cook_context(COOKContext *q) | |||
721 | * Cook initialization | 721 | * Cook initialization |
722 | */ | 722 | */ |
723 | 723 | ||
724 | static inline uint16_t get_uint16be(uint8_t *buf) | ||
725 | { | ||
726 | return (uint16_t)((buf[0] << 8)|buf[1]); | ||
727 | } | ||
728 | |||
729 | static inline uint32_t get_uint32be(uint8_t *buf) | ||
730 | { | ||
731 | return (uint32_t)((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]); | ||
732 | } | ||
733 | |||
734 | int cook_decode_init(RMContext *rmctx, COOKContext *q) | 724 | int cook_decode_init(RMContext *rmctx, COOKContext *q) |
735 | { | 725 | { |
736 | 726 | ||
737 | /* cook extradata */ | 727 | /* cook extradata */ |
738 | q->cookversion = get_uint32be(rmctx->codec_extradata); | 728 | q->cookversion = rm_get_uint32be(rmctx->codec_extradata); |
739 | q->samples_per_frame = get_uint16be(&rmctx->codec_extradata[4]); | 729 | q->samples_per_frame = rm_get_uint16be(&rmctx->codec_extradata[4]); |
740 | q->subbands = get_uint16be(&rmctx->codec_extradata[6]); | 730 | q->subbands = rm_get_uint16be(&rmctx->codec_extradata[6]); |
741 | q->extradata_size = rmctx->extradata_size; | 731 | q->extradata_size = rmctx->extradata_size; |
742 | if (q->extradata_size >= 16){ | 732 | if (q->extradata_size >= 16){ |
743 | q->js_subband_start = get_uint16be(&rmctx->codec_extradata[12]); | 733 | q->js_subband_start = rm_get_uint16be(&rmctx->codec_extradata[12]); |
744 | q->js_vlc_bits = get_uint16be(&rmctx->codec_extradata[14]); | 734 | q->js_vlc_bits = rm_get_uint16be(&rmctx->codec_extradata[14]); |
745 | } | 735 | } |
746 | 736 | ||
747 | /* Take data from the RMContext (RM container). */ | 737 | /* Take data from the RMContext (RM container). */ |