Y4M loader: Fix frame size calculation for 10-bit 4:2:0 format

Seems to fix multiframe images (animation) for this format.
This commit is contained in:
Kim Woelders 2024-04-27 09:45:57 +02:00
parent cf926c746c
commit d4648ae527
1 changed files with 5 additions and 1 deletions

View File

@ -338,11 +338,15 @@ y4m_parse_frame(Y4mParse *res)
case Y4M_PARSE_CS_420MPEG2:
case Y4M_PARSE_CS_420PALDV:
case Y4M_PARSE_CS_420:
case Y4M_PARSE_CS_420P10:
res->frame_data_len = npixels * 3 / 2;
sdiv = 2;
voff = (npixels * 5) / 4;
break;
case Y4M_PARSE_CS_420P10:
res->frame_data_len = npixels * 3;
sdiv = 2;
voff = (npixels * 5) / 4;
break;
case Y4M_PARSE_CS_422:
res->frame_data_len = npixels * 2;
sdiv = 2;