maxest
maxest

Reputation: 91

Video codec: dealing with delta values

Assume I have a ref (key) frame I encoded. Now I want to inter-predict the next frame called delta frame P. To do that I calculate motion vectors and find diff between compensated P and I. However, this diff can be quite huge in some cases. Given that my input color values are in range [0, 255] then the diff can be in [-255, 255] range. This is one more bit of information. How is this usually approached? Is this range scaled down to [-127, 127] or something like that? Or do we just compress higher-precision delta data?

EDIT:

Okay, so I did a few experiments:

a) compressing ref frame - resulting compression ratio x26

Then I took two similar frames and tested and got this:

b) before converting to luma-chroma, I take both frames in RGB, compute their xor and run luma-chroma and DCT - compression ratio x39 - severe artifacts show up

c) I take difference frame1-frame2 and output clamp(frame1-frame2, -0.5, 0.5) + 0.5 - compression ratio - x76

d) I compute DCT of both frame1 and frame2 and compute xor on that - compression ratio x72

So I don't see how b) would work - xoring input RGB doesn't make much sense for me. I think most efficient is c) as it also allows for blurring frame1 and frame2 before taking diff and thus greatly enhances compression

Upvotes: 0

Views: 170

Answers (0)

Related Questions