Implement frame hash metadata
This feature is intended as a tool for checking the encoder - decoder mismatch, including cases of incorrect encoder or decoder operation and mismatches between the encoder and decoder versions.
Frame hash is calculated by the encoder as a hash sum of the reconstructed frame and included in the bitstream as payload of the corresponding metadata. The encoder should be able to optionally turn the metadata on and off with a command line parameter (runtime flag). Upon receiving such metadata, the decoder should calculate the frame hash value for the decoded frame and signal whether there is a match, for each frame and for the whole bitstream.
The following aspects need consideration:
- Cases of film grain and no film grain in the bitstream.
- Hash size and the algorithm speed.
- Decoder controls (warning, failure to decode, frame / bitstream message).