News for hackers. Stuff that matters.
Re:H.264 is magic (2016) by amelius on Friday May 24, 2019 @04:33AM (#19999608)
I don't fully agree that a h.264 system is extremely hard to implement, because it has some nice properties:

- once you have a reference implementation, you can have exact input/output pairs, which makes development easy, especially if the reference implementation exposes intermediate results.

- because of the previous point, testing is easy.

- even if you don't have a reference implementation, you can start by building a slow version of an encoder/decoder, generate testing data (intermediate outputs), and step by step optimize the system, while ensuring the system produces the same outputs at every step.

Re:H.264 is magic (2016) by jwr on Friday May 24, 2019 @02:29PM (#20004090)
Have you tried to implement one? :-) I worked with a team who did a full implementation from scratch (commercially), and I optimized some parts for certain architectures.

The problem is not in getting the output. The reference decoder decodes just fine. The difficult part is getting the output on time, e.g. getting you decoder to run fast.

The reference decoder has not been designed for speed, and getting things to run fast requires architecting everything very differently: it's not just a matter of applying micro-optimizations to reference code.

Also, the "intermediate results" might be different for each decoder architecture, so you can't really rely on the reference code for those.

So yes, while testing is indeed easy, writing a fast decoder is definitely not a "step by step optimization" process. I'd bet every performant decoder out there was rewritten almost completely at least twice.

Re:H.264 is magic (2016) by mycall on Saturday May 25, 2019 @10:55PM (#20012829)
Which are the fastest freely available decoders available, no necessary open source?
Re:H.264 is magic (2016) by wojtekkru on Friday May 24, 2019 @07:47AM (#20000517)
Is it really deterministic mapping from input to output, for given configuration options? I imagine you can build different algorithms that choose what data can be removed, with different tradeoffs between encoding time, decoding time, memory consumption, output file size and experience of quality.
Re:H.264 is magic (2016) by dfox on Friday May 24, 2019 @08:43AM (#20000852)
Decoder is completely deterministic. In fact the normative part of most MPEG standards is implementation of the decoder in C-like pseudocode (which is horribly slow because it is not optimized in any way and mostly deals with discrete bits).

On the other hand how encoder works is not specified at all apart from the obvious requirement that it has to produce something decodable by the above mentioned decoder.