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

Function decode_plane

libavcodec/ffv1.c:886–920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884}
885
886static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
887 int x, y;
888 int_fast16_t sample_buffer[2][w+6];
889 int_fast16_t *sample[2];
890 sample[0]=sample_buffer[0]+3;
891 sample[1]=sample_buffer[1]+3;
892
893 s->run_index=0;
894
895 memset(sample_buffer, 0, sizeof(sample_buffer));
896
897 for(y=0; y<h; y++){
898 int_fast16_t *temp= sample[0]; //FIXME try a normal buffer
899
900 sample[0]= sample[1];
901 sample[1]= temp;
902
903 sample[1][-1]= sample[0][0 ];
904 sample[0][ w]= sample[0][w-1];
905
906//{START_TIMER
907 if(s->avctx->bits_per_raw_sample <= 8){
908 decode_line(s, w, sample, plane_index, 8);
909 for(x=0; x<w; x++){
910 src[x + stride*y]= sample[1][x];
911 }
912 }else{
913 decode_line(s, w, sample, plane_index, s->avctx->bits_per_raw_sample);
914 for(x=0; x<w; x++){
915 ((uint16_t*)(src + stride*y))[x]= sample[1][x] << (16 - s->avctx->bits_per_raw_sample);
916 }
917 }
918//STOP_TIMER("decode-line")}
919 }
920}
921
922static void decode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
923 int x, y, p;

Callers 1

decode_frameFunction · 0.85

Calls 1

decode_lineFunction · 0.85

Tested by

no test coverage detected