| 837 | } |
| 838 | |
| 839 | static int decode_subframe(WmallDecodeCtx *s) |
| 840 | { |
| 841 | int offset = s->samples_per_frame; |
| 842 | int subframe_len = s->samples_per_frame; |
| 843 | int total_samples = s->samples_per_frame * s->num_channels; |
| 844 | int i, j, rawpcm_tile, padding_zeroes, res; |
| 845 | |
| 846 | s->subframe_offset = get_bits_count(&s->gb); |
| 847 | |
| 848 | /* reset channel context and find the next block offset and size |
| 849 | == the next block of the channel with the smallest number of |
| 850 | decoded samples */ |
| 851 | for (i = 0; i < s->num_channels; i++) { |
| 852 | if (offset > s->channel[i].decoded_samples) { |
| 853 | offset = s->channel[i].decoded_samples; |
| 854 | subframe_len = |
| 855 | s->channel[i].subframe_len[s->channel[i].cur_subframe]; |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | /* get a list of all channels that contain the estimated block */ |
| 860 | s->channels_for_cur_subframe = 0; |
| 861 | for (i = 0; i < s->num_channels; i++) { |
| 862 | const int cur_subframe = s->channel[i].cur_subframe; |
| 863 | /* subtract already processed samples */ |
| 864 | total_samples -= s->channel[i].decoded_samples; |
| 865 | |
| 866 | /* and count if there are multiple subframes that match our profile */ |
| 867 | if (offset == s->channel[i].decoded_samples && |
| 868 | subframe_len == s->channel[i].subframe_len[cur_subframe]) { |
| 869 | total_samples -= s->channel[i].subframe_len[cur_subframe]; |
| 870 | s->channel[i].decoded_samples += |
| 871 | s->channel[i].subframe_len[cur_subframe]; |
| 872 | s->channel_indexes_for_cur_subframe[s->channels_for_cur_subframe] = i; |
| 873 | ++s->channels_for_cur_subframe; |
| 874 | } |
| 875 | } |
| 876 | |
| 877 | /* check if the frame will be complete after processing the |
| 878 | estimated block */ |
| 879 | if (!total_samples) |
| 880 | s->parsed_all_subframes = 1; |
| 881 | |
| 882 | |
| 883 | s->seekable_tile = get_bits1(&s->gb); |
| 884 | if (s->seekable_tile) { |
| 885 | clear_codec_buffers(s); |
| 886 | |
| 887 | s->do_arith_coding = get_bits1(&s->gb); |
| 888 | if (s->do_arith_coding) { |
| 889 | avpriv_request_sample(s->avctx, "Arithmetic coding"); |
| 890 | return AVERROR_PATCHWELCOME; |
| 891 | } |
| 892 | s->do_ac_filter = get_bits1(&s->gb); |
| 893 | s->do_inter_ch_decorr = get_bits1(&s->gb); |
| 894 | s->do_mclms = get_bits1(&s->gb); |
| 895 | |
| 896 | if (s->do_ac_filter) |
no test coverage detected