Page MenuHomePhabricator

Patch for Java Theora decoder: Computation of quantization matrices according to spec
Closed, ResolvedPublic

Description

Author: maikmerten

Description:
Proposed patch to implement quantization-matrices setup according to Theora spec

The current incarnation of jheora, the Java Theora decoder used in Cortado, is hardcoded to only support the quantization setup as seen in the VP3-subset of the Theora spec. It e.g. doesn't interpolate between matrices.

I rewrote much of the quant-setup code (Quant.java) according to the Theora spec. Each step is documented by the fitting part of the Theora spec.

This is an extensive (but inevitable) change to the decoder code. It's a prerequisite for implementing more specification features to enable Cortado to play back streams encoded with more advanced encoders.

Some testing has been done to determine if it breaks existing content. More testing welcome.


Version: unspecified
Severity: enhancement

attachment jheora-quantrewrite.diff ignored as obsolete

Details

Reference
bz15119

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:17 PM
bzimport added a project: Cortado-jheora.
bzimport set Reference to bz15119.

Any chance of a differential fuzz test? That is, a program that can feed random input to two decoders, presumably your one and a reference decoder like libtheora, and compare the outputs for any differences? When done correctly, it can be a very sensitive test for the correctness of both decoders, as long as they were written independently.

maikmerten wrote:

As jheora is known to not implement the whole spec (after applying the patch it'll "just" implement a bit more) I see little value into fuzz-testing right now - jheora for sure won't match the reference encoder. What may make sense would be a "batch decoding" setup that ensures a given set of test files decodes without e.g. the decoder terminating due to encountered errors.

FWIW this patch doesn't seem to be quite enough to render the thusnelda encoder test output downloadable from http://xiphmont.livejournal.com/35363.html :(

maikmerten wrote:

This is a known problem. The proposed patch is supposed to prepare the codebase for further changes, it won't by itself enable playback of real-life content the old unpatched decoder wouldn't decode as well.

It's a big change in a region of code that none of us at Wikimedia are familiar with. Could you add some decoder features that we can test, to give us some confidence that you know what you're doing?

maikmerten wrote:

Okay, I'll try to extend the patch so it includes support for the Thusnelda encoder and then resubmit. That way the risk of breaking things at least has the prospect of adding something immediately useful.

maikmerten wrote:

Version 2 of the patch, makes jheora decode Thusnelda clips

Newly attached patch includes the changes of the first proposed patch and additionally enables playback of content encoded with the experimental Thusnelda encoder.

Attached:

maikmerten wrote:

Patch committed. Closing this bug.