| 196 | } |
| 197 | |
| 198 | static void aptx_encode_samples(AptXContext *ctx, |
| 199 | int32_t samples[NB_CHANNELS][4], |
| 200 | uint8_t *output) |
| 201 | { |
| 202 | int channel; |
| 203 | for (channel = 0; channel < NB_CHANNELS; channel++) |
| 204 | aptx_encode_channel(&ctx->channels[channel], samples[channel], ctx->hd); |
| 205 | |
| 206 | aptx_insert_sync(ctx->channels, &ctx->sync_idx); |
| 207 | |
| 208 | for (channel = 0; channel < NB_CHANNELS; channel++) { |
| 209 | ff_aptx_invert_quantize_and_prediction(&ctx->channels[channel], ctx->hd); |
| 210 | if (ctx->hd) |
| 211 | AV_WB24(output + 3*channel, |
| 212 | aptxhd_pack_codeword(&ctx->channels[channel])); |
| 213 | else |
| 214 | AV_WB16(output + 2*channel, |
| 215 | aptx_pack_codeword(&ctx->channels[channel])); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | static int aptx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, |
| 220 | const AVFrame *frame, int *got_packet_ptr) |
no test coverage detected