Need help - JPEGNPP - Block Artefacts after decode and save to yuv

Hey Developers,

i try to decode a jpg file and convert it to yuv plane file.

Everything works fine, the Problem is that i get some kind of strange block artifacts.

I’ve tried different JPG files, but with my ones i will get that result, other works fine.

I looked through the JPG file with an analyzer, but i cant find any mistakes with the marker…

BTW: The Pictures comes from a security camera!

Thanks for help!

Best regards Kukusz

Each 8x8 block seems horizontally mirrored to me. hmm

Sounds good, but the complete Picture is just split by half and i dont know why…

I use the Inverted Discrete Cosine Transformation, maybe this is the Problem…

I’ve tried a new Image with two colored lines and one circle, but i cant figure out whats the


what kind of YUV viewer is used in your screenshot?

i forgot where i download it. Its a standalone exe, search Google, for me it was easy to find…

BTW: i found the mistake but for the first i cant find the source of it. Maybe this jpeg is not

compatible with the inverted DCT

Maybe this particular YUV viewer expects the data in a different interleaving format than you feed it.
Or maybe it uses different chroma downsampling?


Nope, i solved it by recoding the 8x8 blocks through a lot of Iteration Loops. Little example

Picture: number = 8x8 pixelblock, | = middle of picture

1, 2| 3, 4 1,3|2,4 1,5|2,6
5, 6| 7, 8 -> 5,7|6,8 -> 3,7|4,8
9, 10| 11, 12 9,11|10,12 9,13|10,14
13, 14| 15, 16 13,15|14,16 11,15|12,16

  1. Comb left blocks with right block, then swap in every 2x2 block, left down with right up

Very strange that type of Decoding…

Greeting Chris

Sh*t sorry for the bad Format ;-)