jemk / cedrus

https://linux-sunxi.org/VE_Register_guide
47 stars 29 forks source link

Top left corner "pink rectangle" glitch (I found fix) #9

Open rep-stosw opened 2 years ago

rep-stosw commented 2 years ago

In some frame sizes (160x128, 480x320, ...) there was a glitch in top left corner.

Solution: in function h264enc *h264enc_new(const struct h264enc_params *p) need to increase size for buffers:

    /* allocate reference picture memory */
    unsigned int luma_size = ALIGN(c->mb_width * 16, 32) * ALIGN(c->mb_height * 16, 32);
    unsigned int chroma_size = ALIGN(c->mb_width * 16, 32) * ALIGN(c->mb_height * 8, 32);

luma_size*=2;  //ugly fix
chroma_size*=2;

This fix this problem!

JPG Clipboard01