Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Y4M parsing #1241

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions libvmaf/tools/vmaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ static int fetch_picture(video_input *vid, VmafPicture *pic)
for (unsigned i = 0; i < 3; i++) {
int xdec = i&&!(info.pixel_fmt&1);
int ydec = i&&!(info.pixel_fmt&2);
int xstride = info.depth > 8 ? 2 : 1;
uint8_t *ycbcr_data = ycbcr[i].data +
(info.pic_y >> ydec) * ycbcr[i].stride +
(info.pic_x * xstride >> xdec);
(info.pic_x >> xdec);
// ^ gross, but this is how the daala y4m API works. FIXME.
uint8_t *pic_data = pic->data[i];

Expand All @@ -106,10 +105,9 @@ static int fetch_picture(video_input *vid, VmafPicture *pic)
for (unsigned i = 0; i < 3; i++) {
int xdec = i&&!(info.pixel_fmt&1);
int ydec = i&&!(info.pixel_fmt&2);
int xstride = info.depth > 8 ? 2 : 1;
uint16_t *ycbcr_data = (uint16_t*) ycbcr[i].data +
(info.pic_y >> ydec) * (ycbcr[i].stride / 2) +
(info.pic_x * xstride >> xdec);
(info.pic_x >> xdec);
// ^ gross, but this is how the daala y4m API works. FIXME.
uint16_t *pic_data = pic->data[i];

Expand Down
Loading