static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
    int x,y,i;
    const int ring_size= s->avctx->context_model ? 3 : 2;
    int_fast16_t sample_buffer[ring_size][w+6], *sample[ring_size];
    s->run_index=0;
    memset(sample_buffer, 0, sizeof(sample_buffer));
    for(y=0; y<h; y++){
        for(i=0; i<ring_size; i++)
            sample[i]= sample_buffer[(h+i-y)%ring_size]+3;
        sample[0][-1]= sample[1][0  ];
        sample[1][ w]= sample[1][w-1];
        for(x=0; x<w; x++){
            sample[0][x]= src[x + stride*y];
        }
        encode_line(s, w, sample, plane_index, 8);
    }
}
['static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){\n    int x,y,i;\n    const int ring_size= s->avctx->context_model ? 3 : 2;\n    int_fast16_t sample_buffer[ring_size][w+6], *sample[ring_size];\n    s->run_index=0;\n    memset(sample_buffer, 0, sizeof(sample_buffer));\n    for(y=0; y<h; y++){\n        for(i=0; i<ring_size; i++)\n            sample[i]= sample_buffer[(h+i-y)%ring_size]+3;\n        sample[0][-1]= sample[1][0  ];\n        sample[1][ w]= sample[1][w-1];\n        for(x=0; x<w; x++){\n            sample[0][x]= src[x + stride*y];\n        }\n        encode_line(s, w, sample, plane_index, 8);\n    }\n}']