// SGcod
bytestream_put_byte(&s->buf, 0); // progression level
bytestream_put_be16(&s->buf, 1); // num of layers
- bytestream_put_byte(&s->buf, 0); // multiple component transformation
+ if(s->avctx->pix_fmt == PIX_FMT_YUV444P){
+ bytestream_put_byte(&s->buf, 2); // ICT
+ }else{
+ bytestream_put_byte(&s->buf, 0); // unspecified
+ }
// SPcod
bytestream_put_byte(&s->buf, codsty->nreslevels - 1); // num of decomp. levels
bytestream_put_byte(&s->buf, codsty->log2_cblk_width-2); // cblk width
uint8_t *psotptr;
if (s->buf_end - s->buf < 12)
- return -1;
+ return NULL;
bytestream_put_be16(&s->buf, J2K_SOT);
bytestream_put_be16(&s->buf, 10); // Lsot
int *ptr = t1.data[y-yy0];
for (x = xx0; x < xx1; x++){
*ptr = (comp->data[(comp->coord[0][1] - comp->coord[0][0]) * y + x]);
- *ptr++ = (int64_t)*ptr * (int64_t)(8192 * 8192 / band->stepsize) >> 13 - NMSEDEC_FRACBITS;
+ *ptr = (int64_t)*ptr * (int64_t)(8192 * 8192 / band->stepsize) >> 13 - NMSEDEC_FRACBITS;
+ *ptr++;
}
}
}
for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++){
uint8_t *psotptr;
- if ((psotptr = put_sot(s, tileno)) < 0)
- return psotptr;
+ if (!(psotptr = put_sot(s, tileno)))
+ return -1;
if (s->buf_end - s->buf < 2)
return -1;
bytestream_put_be16(&s->buf, J2K_SOD);
encode_frame,
j2kenc_destroy,
.capabilities= CODEC_CAP_EXPERIMENTAL,
+ .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
.pix_fmts =
- (enum PixelFormat[]) {PIX_FMT_GRAY8, PIX_FMT_RGB24,
+ (enum PixelFormat[]) {PIX_FMT_RGB24, PIX_FMT_YUV444P, PIX_FMT_GRAY8,
+/* PIX_FMT_YUV420P,
PIX_FMT_YUV422P, PIX_FMT_YUV444P,
- PIX_FMT_YUV410P, PIX_FMT_YUV411P,
+ PIX_FMT_YUV410P, PIX_FMT_YUV411P,*/
-1}
};