49 #if CONFIG_CLJR_DECODER
51 void *
data,
int *got_frame,
55 int buf_size = avpkt->
size;
72 "Resolution larger than buffer size. Invalid header?\n");
86 for (y = 0; y < avctx->
height; y++) {
90 for (x = 0; x < avctx->
width; x += 4) {
91 luma[3] = (
get_bits(&gb, 5)*33) >> 2;
92 luma[2] = (
get_bits(&gb, 5)*33) >> 2;
93 luma[1] = (
get_bits(&gb, 5)*33) >> 2;
94 luma[0] = (
get_bits(&gb, 5)*33) >> 2;
135 #if CONFIG_CLJR_ENCODER
137 const AVFrame *p,
int *got_packet)
143 static const uint32_t ordered_dither[2][2] =
145 { 0x10400000, 0x104F0000 },
146 { 0xCB2A0000, 0xCB250000 },
157 for (y = 0; y < avctx->
height; y++) {
161 for (x = 0; x < avctx->
width; x += 4) {
163 case 0: dither = 0x492A0000;
break;
164 case 1: dither = dither * 1664525 + 1013904223;
break;
165 case 2: dither = ordered_dither[ y&1 ][ (x>>2)&1 ];
break;
167 put_bits(&pb, 5, (249*(luma[3] + (dither>>29) )) >> 11);
168 put_bits(&pb, 5, (249*(luma[2] + ((dither>>26)&7))) >> 11);
169 put_bits(&pb, 5, (249*(luma[1] + ((dither>>23)&7))) >> 11);
170 put_bits(&pb, 5, (249*(luma[0] + ((dither>>20)&7))) >> 11);
172 put_bits(&pb, 6, (253*(*(cb++) + ((dither>>18)&3))) >> 10);
173 put_bits(&pb, 6, (253*(*(cr++) + ((dither>>16)&3))) >> 10);
185 #define OFFSET(x) offsetof(CLJRContext, x)
186 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
209 .priv_class = &
class,