Skip to content

Commit

Permalink
Fix Y4M parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
nilfm99 authored and kylophone committed Nov 1, 2023
1 parent af31e4c commit 877215b
Showing 1 changed file with 2 additions and 4 deletions.
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

0 comments on commit 877215b

Please sign in to comment.