phoboslab / pl_mpeg

Single file C library for decoding MPEG1 Video and MP2 Audio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Green rectangles when decoding

ric-a-tic opened this issue · comments

I'm porting pl_mpeg_player.c to GLFW and it decodes smoothly and accurately, except for these rectangles which appear in the areas of the video which are updating. (The colors are accurate where there is no movement.)

I'm hoping that someone knows at a glance what I'm doing wrong. Is there a step that, when skipped, results in these artifacts? The same artifacting appears regardless of whether I'm using the three-texture YCRCB approach or the one-texture RGB approach; they work equally well and give the same result.

I'd like to thank the creator for his hard work; this is a fantastic library with a ton of utility for creators such as myself.
2021-09-24 15_51_41-WIP
2021-09-24 17_19_45-WIP

It seems to be rendering i-frames improperly, but I'm following every step as the example, creating the same textures populated with the same properties, updating with the same on_video function, etc. What is this data and where is it coming from?

edit: This is NOT an issue with the library. It was my fault. I was explicitly casting something I shouldn't have been casting.