40 const AVFrame *p,
int *got_packet)
46 static const uint32_t ordered_dither[2][2] =
48 { 0x10400000, 0x104F0000 },
49 { 0xCB2A0000, 0xCB250000 },
54 "Widths which are not a multiple of 4 might fail with some decoders, "
55 "use vstrict=-1 / -strict -1 to use %d anyway.\n", avctx->
width);
64 for (y = 0; y < avctx->
height; y++) {
69 for (x = 0; x < avctx->
width; x += 4) {
71 case 0: dither = 0x492A0000;
break;
72 case 1: dither = dither * 1664525 + 1013904223;
break;
73 case 2: dither = ordered_dither[ y&1 ][ (x>>2)&1 ];
break;
75 if (x+3 >= avctx->
width) {
76 memset(luma_tmp, 0,
sizeof(luma_tmp));
77 memcpy(luma_tmp, luma, avctx->
width - x);
80 put_bits(&pb, 5, (249*(luma[3] + (dither>>29) )) >> 11);
81 put_bits(&pb, 5, (249*(luma[2] + ((dither>>26)&7))) >> 11);
82 put_bits(&pb, 5, (249*(luma[1] + ((dither>>23)&7))) >> 11);
83 put_bits(&pb, 5, (249*(luma[0] + ((dither>>20)&7))) >> 11);
85 put_bits(&pb, 6, (253*(*(cb++) + ((dither>>18)&3))) >> 10);
86 put_bits(&pb, 6, (253*(*(cr++) + ((dither>>16)&3))) >> 10);
98 #define OFFSET(x) offsetof(CLJRContext, x)
99 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM