MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / parse_frame

Function parse_frame

libavcodec/dca_xll.c:1053–1088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1051}
1052
1053static int parse_frame(DCAXllDecoder *s, const uint8_t *data, int size, DCAExssAsset *asset)
1054{
1055 int ret;
1056
1057 if ((ret = init_get_bits8(&s->gb, data, size)) < 0)
1058 return ret;
1059 if ((ret = parse_common_header(s)) < 0)
1060 return ret;
1061 if ((ret = parse_sub_headers(s, asset)) < 0)
1062 return ret;
1063 if ((ret = parse_navi_table(s)) < 0)
1064 return ret;
1065 if ((ret = parse_band_data(s)) < 0)
1066 return ret;
1067
1068 if (s->frame_size * 8 > FFALIGN(get_bits_count(&s->gb), 32)) {
1069 unsigned int extradata_syncword;
1070
1071 // Align to dword
1072 skip_bits_long(&s->gb, -get_bits_count(&s->gb) & 31);
1073
1074 extradata_syncword = show_bits_long(&s->gb, 32);
1075
1076 if (extradata_syncword == DCA_SYNCWORD_XLL_X) {
1077 s->x_syncword_present = 1;
1078 } else if ((extradata_syncword >> 1) == (DCA_SYNCWORD_XLL_X_IMAX >> 1)) {
1079 s->x_imax_syncword_present = 1;
1080 }
1081 }
1082
1083 if (ff_dca_seek_bits(&s->gb, s->frame_size * 8)) {
1084 av_log(s->avctx, AV_LOG_ERROR, "Read past end of XLL frame\n");
1085 return AVERROR_INVALIDDATA;
1086 }
1087 return ret;
1088}
1089
1090static void clear_pbr(DCAXllDecoder *s)
1091{

Callers 2

parse_frame_no_pbrFunction · 0.85
parse_frame_pbrFunction · 0.85

Calls 10

init_get_bits8Function · 0.85
parse_common_headerFunction · 0.85
parse_sub_headersFunction · 0.85
parse_navi_tableFunction · 0.85
parse_band_dataFunction · 0.85
get_bits_countFunction · 0.85
skip_bits_longFunction · 0.85
show_bits_longFunction · 0.85
ff_dca_seek_bitsFunction · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected