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

Function encode_plane

libavcodec/ffv1.c:509–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507}
508
509static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
510 int x,y,i;
511 const int ring_size= s->avctx->context_model ? 3 : 2;
512 int_fast16_t sample_buffer[ring_size][w+6], *sample[ring_size];
513 s->run_index=0;
514
515 memset(sample_buffer, 0, sizeof(sample_buffer));
516
517 for(y=0; y<h; y++){
518 for(i=0; i<ring_size; i++)
519 sample[i]= sample_buffer[(h+i-y)%ring_size]+3;
520
521 sample[0][-1]= sample[1][0 ];
522 sample[1][ w]= sample[1][w-1];
523//{START_TIMER
524 if(s->avctx->bits_per_raw_sample<=8){
525 for(x=0; x<w; x++){
526 sample[0][x]= src[x + stride*y];
527 }
528 encode_line(s, w, sample, plane_index, 8);
529 }else{
530 for(x=0; x<w; x++){
531 sample[0][x]= ((uint16_t*)(src + stride*y))[x] >> (16 - s->avctx->bits_per_raw_sample);
532 }
533 encode_line(s, w, sample, plane_index, s->avctx->bits_per_raw_sample);
534 }
535//STOP_TIMER("encode line")}
536 }
537}
538
539static void encode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
540 int x, y, p, i;

Callers 1

encode_frameFunction · 0.85

Calls 1

encode_lineFunction · 0.85

Tested by

no test coverage detected