int raten, rated, aspectn, aspectd, n;
char inter;
const char *colorspace = "";
+ const char *colorrange = "";
int field_order;
st = s->streams[0];
FF_ENABLE_DEPRECATION_WARNINGS
#endif
+ switch(st->codecpar->color_range) {
+ case AVCOL_RANGE_MPEG:
+ colorrange = " XCOLORRANGE=LIMITED";
+ break;
+ case AVCOL_RANGE_JPEG:
+ colorrange = " XCOLORRANGE=FULL";
+ break;
+ default:
+ break;
+ }
+
switch (field_order) {
case AV_FIELD_TB:
case AV_FIELD_TT: inter = 't'; break;
case AV_PIX_FMT_YUV411P:
colorspace = " C411 XYSCSS=411";
break;
+ case AV_PIX_FMT_YUVJ420P:
+ colorspace = " C420jpeg XYSCSS=420JPEG";
+ colorrange = " XCOLORRANGE=FULL";
+ break;
+ case AV_PIX_FMT_YUVJ422P:
+ colorspace = " C422 XYSCSS=422";
+ colorrange = " XCOLORRANGE=FULL";
+ break;
+ case AV_PIX_FMT_YUVJ444P:
+ colorspace = " C444 XYSCSS=444";
+ colorrange = " XCOLORRANGE=FULL";
+ break;
case AV_PIX_FMT_YUV420P:
switch (st->codecpar->chroma_location) {
case AVCHROMA_LOC_TOPLEFT: colorspace = " C420paldv XYSCSS=420PALDV"; break;
}
/* construct stream header, if this is the first frame */
- n = snprintf(buf, Y4M_LINE_MAX, "%s W%d H%d F%d:%d I%c A%d:%d%s\n",
+ n = snprintf(buf, Y4M_LINE_MAX, "%s W%d H%d F%d:%d I%c A%d:%d%s%s\n",
Y4M_MAGIC, width, height, raten, rated, inter,
- aspectn, aspectd, colorspace);
+ aspectn, aspectd, colorspace, colorrange);
return n;
}
+
static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
{
AVStream *st = s->streams[pkt->stream_index];
case AV_PIX_FMT_YUV420P:
case AV_PIX_FMT_YUV422P:
case AV_PIX_FMT_YUV444P:
+ // TODO: remove YUVJ pixel formats when they are completely removed from the codebase.
+ case AV_PIX_FMT_YUVJ420P:
+ case AV_PIX_FMT_YUVJ422P:
+ case AV_PIX_FMT_YUVJ444P:
break;
case AV_PIX_FMT_GRAY9:
case AV_PIX_FMT_GRAY10:
case AV_PIX_FMT_YUV420P:
case AV_PIX_FMT_YUV422P:
case AV_PIX_FMT_YUV444P:
+ // TODO: remove YUVJ pixel formats when they are completely removed from the codebase.
+ case AV_PIX_FMT_YUVJ420P:
+ case AV_PIX_FMT_YUVJ422P:
+ case AV_PIX_FMT_YUVJ444P:
break;
case AV_PIX_FMT_GRAY9:
case AV_PIX_FMT_GRAY10: