| 1254 | } |
| 1255 | |
| 1256 | static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, |
| 1257 | const AVFrame *frame, int *got_packet_ptr) |
| 1258 | { |
| 1259 | DCAEncContext *c = avctx->priv_data; |
| 1260 | const int32_t *samples; |
| 1261 | int ret, i; |
| 1262 | |
| 1263 | if ((ret = ff_get_encode_buffer(avctx, avpkt, c->frame_size, 0)) < 0) |
| 1264 | return ret; |
| 1265 | |
| 1266 | samples = (const int32_t *)frame->data[0]; |
| 1267 | |
| 1268 | subband_transform(c, samples); |
| 1269 | if (c->lfe_channel) |
| 1270 | lfe_downsample(c, samples); |
| 1271 | |
| 1272 | calc_masking(c, samples); |
| 1273 | if (c->options.adpcm_mode) |
| 1274 | adpcm_analysis(c); |
| 1275 | find_peaks(c); |
| 1276 | assign_bits(c); |
| 1277 | calc_lfe_scales(c); |
| 1278 | shift_history(c, samples); |
| 1279 | |
| 1280 | init_put_bits(&c->pb, avpkt->data, avpkt->size); |
| 1281 | fill_in_adpcm_bufer(c); |
| 1282 | put_frame_header(c); |
| 1283 | put_primary_audio_header(c); |
| 1284 | for (i = 0; i < SUBFRAMES; i++) |
| 1285 | put_subframe(c, i); |
| 1286 | |
| 1287 | flush_put_bits(&c->pb); |
| 1288 | memset(put_bits_ptr(&c->pb), 0, put_bytes_left(&c->pb, 0)); |
| 1289 | |
| 1290 | *got_packet_ptr = 1; |
| 1291 | return 0; |
| 1292 | } |
| 1293 | |
| 1294 | #define DCAENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM |
| 1295 |
nothing calls this directly
no test coverage detected