Revision b0e1d0d9

View differences:

libavcodec/ffv1.c
252 252
    int colorspace;
253 253
    int_fast16_t *sample_buffer;
254 254
    int gob_count;
255
    int packed_at_lsb;
255 256

  
256 257
    int quant_table_count;
257 258

  
......
609 610
            }
610 611
            encode_line(s, w, sample, plane_index, 8);
611 612
        }else{
612
            for(x=0; x<w; x++){
613
                sample[0][x]= ((uint16_t*)(src + stride*y))[x] >> (16 - s->avctx->bits_per_raw_sample);
613
            if(s->packed_at_lsb){
614
                for(x=0; x<w; x++){
615
                    sample[0][x]= ((uint16_t*)(src + stride*y))[x];
616
                }
617
            }else{
618
                for(x=0; x<w; x++){
619
                    sample[0][x]= ((uint16_t*)(src + stride*y))[x] >> (16 - s->avctx->bits_per_raw_sample);
620
                }
614 621
            }
615 622
            encode_line(s, w, sample, plane_index, s->avctx->bits_per_raw_sample);
616 623
        }
......
966 973

  
967 974
    avctx->coded_frame= &s->picture;
968 975
    switch(avctx->pix_fmt){
976
    case PIX_FMT_YUV420P10:
977
    case PIX_FMT_YUV422P10:
978
        s->packed_at_lsb = 1;
969 979
    case PIX_FMT_YUV444P16:
970 980
    case PIX_FMT_YUV422P16:
971 981
    case PIX_FMT_YUV420P16:
......
1812 1822
    encode_frame,
1813 1823
    common_end,
1814 1824
    .capabilities = CODEC_CAP_SLICE_THREADS,
1815
    .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_RGB32, PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, PIX_FMT_YUV444P16, PIX_FMT_NONE},
1825
    .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_RGB32, PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, PIX_FMT_YUV444P16, PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, PIX_FMT_NONE},
1816 1826
    .long_name= NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
1817 1827
};
1818 1828
#endif

Also available in: Unified diff