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

Function init_frame

libavcodec/flacenc.c:372–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372static void init_frame(FlacEncodeContext *s)
373{
374 int i, ch;
375 FlacFrame *frame;
376
377 frame = &s->frame;
378
379 for(i=0; i<16; i++) {
380 if(s->avctx->frame_size == ff_flac_blocksize_table[i]) {
381 frame->blocksize = ff_flac_blocksize_table[i];
382 frame->bs_code[0] = i;
383 frame->bs_code[1] = 0;
384 break;
385 }
386 }
387 if(i == 16) {
388 frame->blocksize = s->avctx->frame_size;
389 if(frame->blocksize <= 256) {
390 frame->bs_code[0] = 6;
391 frame->bs_code[1] = frame->blocksize-1;
392 } else {
393 frame->bs_code[0] = 7;
394 frame->bs_code[1] = frame->blocksize-1;
395 }
396 }
397
398 for(ch=0; ch<s->channels; ch++) {
399 frame->subframes[ch].obits = 16;
400 }
401}
402
403/**
404 * Copy channel-interleaved input samples into separate subframes

Callers 1

flac_encode_frameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected