I had posted this in the Theora mailing list, but that the wrong place to ask this question. So I''m reposting here. Has anyone posted a data structure dump of one of the sample Theora files for use in verifying a new decoder? For example, the loop filter limits I''ve decoded for the 320x240.ogg example file are: Loop Filter Limits (5 bits per limit) 00: 1E 19 14 14 0F 0F 0E 0E 08: 0D 0D 0C 0C 0B 0B 0A 0A 16: 09 09 08 08 07 07 07 07 24: 06 06 06 06 05 05 05 05 32: 04 04 04 04 03 03 03 03 40: 02 02 02 02 02 02 02 02 48: 00 00 00 00 00 00 00 00 56: 00 00 00 00 00 00 00 00 I''ve since been able to verify these (and other) values through the dump-video sample program by printing out the contents of its internal data structures at run-time, but it would be nice to have a more accessible reference to validate the operation of my decoder. I have some questions about reading the quantization parameters and generating the matrices that I haven''t been able to answer via the dump-video program, so having all the run-time data structures available for comparison would be a great help.
Tony O''Bryan wrote:> Has anyone posted a data structure dump of one of the sample Theora files for > use in verifying a new decoder? For example, the loop filter limits I''veNot that I know of. I''ve considered adding an example like this as an appendix to the spec, but never found the time.> I have some questions about reading the quantization parameters and generating > the matrices that I haven''t been able to answer via the dump-video program, so > having all the run-time data structures available for comparison would be a > great help.Please let us know if you find areas of the spec unclear, or have other specific questions that are not answered in it.
On Saturday February 20 2010, Timothy B. Terriberry wrote:> Not that I know of. I''ve considered adding an example like this as an > appendix to the spec, but never found the time.While writing my decoder, I posted some of the data structures I''ve read from the first 320x240.ogg example file, and which match the numbers read by the dump-video program, to the theora mailing list. I can repost them here if you''d like to include them in a future appendix.> Please let us know if you find areas of the spec unclear, or have other > specific questions that are not answered in it.Section 6.4.3 of the specification (Computing a Quantization Matrix) says: 1. Assign qri the index of a quant range such that qi >= summation from qrj=0 to qri-1 (QRSIZES[qti][pli ][qrj ]) and qi <= summation from qrj=0 to qri (QRSIZES[qti ][pli ][qrj ]) How do I determine which qri to select so that qi will fall between the specified value range? Or will a valid Theora file always result in a summation that automatically satisfies that requirement, regardless of which qri I select?
Tony O''Bryan wrote:> While writing my decoder, I posted some of the data structures I''ve read from > the first 320x240.ogg example file, and which match the numbers read by the > dump-video program, to the theora mailing list. I can repost them here if > you''d like to include them in a future appendix.I was actually thinking more along the lines of going through the complete decoder process for a very small stream (e.g., a superblock or two for two frames, to cover intra and inter frames), specifically designed to exercise most of the features of the bitstream, and showing the (non-local) values computed by each section of the spec. This is a bit more work.> Section 6.4.3 of the specification (Computing a Quantization Matrix) says: > > 1. Assign qri the index of a quant range such that > > qi >= summation from qrj=0 to qri-1 (QRSIZES[qti][pli ][qrj ]) > > and > > qi <= summation from qrj=0 to qri (QRSIZES[qti ][pli ][qrj ]) > > > > How do I determine which qri to select so that qi will fall between the > specified value range? Or will a valid Theora file always result in a summation > that automatically satisfies that requirement, regardless of which qri I > select?Work through 6.4.2 step 7(a)iv. It fills in the QRSIZES array until the sum of all of them is exactly 63 (for a valid stream). qi is also in the range 0 to 63, so there will be _some_ qri where the sum of the sizes before is no larger than qi, but adding in the size of that range makes the sum at least as large as qi. It''s not "regardless of which qri", but there''s guaranteed to _a_ qri that works, and you can just step through them until you find it.
On Saturday February 20 2010, Timothy B. Terriberry wrote:> It''s not "regardless of which qri", but > there''s guaranteed to a qri that works, and you can just step through > them until you find it.Okay, that''s what I needed to know. Thanks for the help.