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

Function write_header

libavcodec/ffv1.c:593–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591}
592
593static void write_header(FFV1Context *f){
594 uint8_t state[CONTEXT_SIZE];
595 int i;
596 RangeCoder * const c= &f->c;
597
598 memset(state, 128, sizeof(state));
599
600 put_symbol(c, state, f->version, 0);
601 put_symbol(c, state, f->ac, 0);
602 if(f->ac>1){
603 for(i=1; i<256; i++){
604 f->state_transition[i]=ver2_state[i];
605 put_symbol(c, state, ver2_state[i] - c->one_state[i], 1);
606 }
607 }
608 put_symbol(c, state, f->colorspace, 0); //YUV cs type
609 if(f->version>0)
610 put_symbol(c, state, f->avctx->bits_per_raw_sample, 0);
611 put_rac(c, state, 1); //chroma planes
612 put_symbol(c, state, f->chroma_h_shift, 0);
613 put_symbol(c, state, f->chroma_v_shift, 0);
614 put_rac(c, state, 0); //no transparency plane
615
616 for(i=0; i<5; i++)
617 write_quant_table(c, f->quant_table[i]);
618}
619#endif /* CONFIG_FFV1_ENCODER */
620
621static av_cold int common_init(AVCodecContext *avctx){

Callers 1

encode_frameFunction · 0.70

Calls 3

put_racFunction · 0.85
write_quant_tableFunction · 0.85
put_symbolFunction · 0.70

Tested by

no test coverage detected