Commit c1c15e0d authored by Raphaël Zumer's avatar Raphaël Zumer

Handle chroma position in 4:2:0 Y4M output

parent b1adc7cf
......@@ -49,14 +49,24 @@ static int y4m2_open(Y4m2OutputContext *const c, const char *const file,
return -1;
}
static const char *const ss_name[][2] = {
static const char *const ss_names[][2] = {
[DAV1D_PIXEL_LAYOUT_I400] = { "mono", "mono10" },
[DAV1D_PIXEL_LAYOUT_I420] = { "420jpeg", "420p10" },
[DAV1D_PIXEL_LAYOUT_I422] = { "422", "422p10" },
[DAV1D_PIXEL_LAYOUT_I444] = { "444", "444p10" }
};
static const char *const chr_names_8bpc_i420[] = {
[DAV1D_CHR_UNKNOWN] = "420jpeg",
[DAV1D_CHR_VERTICAL] = "420mpeg2",
[DAV1D_CHR_COLOCATED] = "420"
};
const char *const ss_name = p->layout == DAV1D_PIXEL_LAYOUT_I420 && p->bpc == 8 ?
chr_names_8bpc_i420[p->chr] : ss_names[p->layout][p->bpc > 8];
fprintf(c->f, "YUV4MPEG2 W%d H%d C%s Ip F%d:%d\n",
p->w, p->h, ss_name[p->layout][p->bpc > 8], fps[0], fps[1]);
p->w, p->h, ss_name, fps[0], fps[1]);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment