| 1121 | } |
| 1122 | |
| 1123 | static void output_subframes(FlacEncodeContext *s) |
| 1124 | { |
| 1125 | FlacFrame *frame; |
| 1126 | FlacSubframe *sub; |
| 1127 | int ch; |
| 1128 | |
| 1129 | frame = &s->frame; |
| 1130 | |
| 1131 | for(ch=0; ch<s->channels; ch++) { |
| 1132 | sub = &frame->subframes[ch]; |
| 1133 | |
| 1134 | /* subframe header */ |
| 1135 | put_bits(&s->pb, 1, 0); |
| 1136 | put_bits(&s->pb, 6, sub->type_code); |
| 1137 | put_bits(&s->pb, 1, 0); /* no wasted bits */ |
| 1138 | |
| 1139 | /* subframe */ |
| 1140 | if(sub->type == FLAC_SUBFRAME_CONSTANT) { |
| 1141 | output_subframe_constant(s, ch); |
| 1142 | } else if(sub->type == FLAC_SUBFRAME_VERBATIM) { |
| 1143 | output_subframe_verbatim(s, ch); |
| 1144 | } else if(sub->type == FLAC_SUBFRAME_FIXED) { |
| 1145 | output_subframe_fixed(s, ch); |
| 1146 | } else if(sub->type == FLAC_SUBFRAME_LPC) { |
| 1147 | output_subframe_lpc(s, ch); |
| 1148 | } |
| 1149 | } |
| 1150 | } |
| 1151 | |
| 1152 | static void output_frame_footer(FlacEncodeContext *s) |
| 1153 | { |
no test coverage detected