7 years agoRemove some redundant NULL checks and fix a free on error return.
Tim Terriberry [Fri, 2 Mar 2012 23:38:12 +0000 (23:38 +0000)]
Remove some redundant NULL checks and fix a free on error return.

ref_frame_data was being allocated with the aligned allocator, but
 freed with the normal _ogg_free() function on failure, which
 doesn't work.
This would only cause a problem if there was just enough memory to
 satisfy the reference frame allocation (just over 4.5 or 9 bytes
 per pixel) but not enough for the fragment buffer offets (1/16 or
 1/8th byte per pixel).

svn path=/trunk/theora/; revision=18219

7 years agoMake telemetry work with striped decoding.
Tim Terriberry [Fri, 2 Mar 2012 21:36:29 +0000 (21:36 +0000)]
Make telemetry work with striped decoding.

This allows it to be used from dump_video without having to disable
 striped decoding there.

svn path=/trunk/theora/; revision=18218

7 years agoFix a duplicate word.
Ralph Giles [Sat, 11 Feb 2012 02:22:09 +0000 (02:22 +0000)]
Fix a duplicate word.

Thanks to darkstarbyte for pointing out the typo.

svn path=/trunk/theora/; revision=18195

7 years agoClean up some ARM asm issues.
Tim Terriberry [Wed, 13 Jul 2011 20:28:34 +0000 (20:28 +0000)]
Clean up some ARM asm issues.

1) Allow specification of the section alignment and make the
    default alignment 4 bytes (like the RVCT manual says it should
   This ensures that linking our ARM asm into a Thumb executable
    won't get the section placed on a 2-byte boundary.
2) Add a linker hint to indicate we don't need an executable stack.
   Otherwise it assumes we do.
3) Stop building and linking to an (empty) armopts object file.
   This is needed to make 2) work, since we include this file, so
    we can't add the linker hint at the end of it, and linking in
    just one object without that hint makes the whole library ask
    for an executable stack.

svn path=/trunk/theora/; revision=18031

7 years agoAdd Brad Smith to AUTHORS.
Tim Terriberry [Tue, 31 May 2011 18:34:27 +0000 (18:34 +0000)]
Add Brad Smith to AUTHORS.

This is a more proper attribution for r17993.

svn path=/trunk/theora/; revision=18008

7 years agoUse $host instead of $target in configure
David Schleef [Sun, 29 May 2011 20:23:31 +0000 (20:23 +0000)]
Use $host instead of $target in configure

Because we just removed target by removing AC_CANONICAL_TARGET,
and host is correct anyway.

svn path=/trunk/theora/; revision=18006

7 years agoRevert player_example changes accidentally included in r17994.
Tim Terriberry [Fri, 20 May 2011 22:08:35 +0000 (22:08 +0000)]
Revert player_example changes accidentally included in r17994.

svn path=/trunk/theora/; revision=17995

7 years agoUpdate the documentation for theora_encode_comment().
Tim Terriberry [Fri, 20 May 2011 21:27:08 +0000 (21:27 +0000)]
Update the documentation for theora_encode_comment().

It wrongly claimed the returned buffer was owned by libtheora, when
 in reality libtheora was creating a temporary buffer and not
 storing the pointer to the returned packet anywhere.
Since there's no encoder parameter passed to this function, it
 doesn't even have a place to store it.
This situation is sub-optimal, but can be solved by migrating to
 the 1.0 API, which does require an encoder instance to encode a
 comment, and thus does not have this problem.

Fixes #726.

svn path=/trunk/theora/; revision=17994

7 years agoOnly link libcompat with dump_video.
Tim Terriberry [Fri, 20 May 2011 21:04:42 +0000 (21:04 +0000)]
Only link libcompat with dump_video.

It's the only example that needs it.
Patch by 0brad0.
Fixes #1587.

svn path=/trunk/theora/; revision=17993

7 years agoCorrect an operator precedence error in the visualization code.
Tim Terriberry [Fri, 20 May 2011 20:57:21 +0000 (20:57 +0000)]
Correct an operator precedence error in the visualization code.

Fixes #1751.

svn path=/trunk/theora/; revision=17992

7 years agoRemove AC_CANONICAL_TARGET.
Tim Terriberry [Fri, 20 May 2011 20:44:34 +0000 (20:44 +0000)]

David Schleef tells me this is only for compilers.
Fixes one part of #1800.

svn path=/trunk/theora/; revision=17991

7 years agoMake autoreconf -i -f work.
Tim Terriberry [Fri, 20 May 2011 20:41:50 +0000 (20:41 +0000)]
Make autoreconf -i -f work.

Patch from David Schleef.

svn path=/trunk/theora/; revision=17990

7 years agoFix two spelling errors in the comments.
Tim Terriberry [Thu, 19 May 2011 14:30:15 +0000 (14:30 +0000)]
Fix two spelling errors in the comments.

Patch by mnemo.
Fixes #1804.

svn path=/trunk/theora/; revision=17989

7 years agoAnother overflow fix.
Tim Terriberry [Wed, 4 May 2011 19:27:58 +0000 (19:27 +0000)]
Another overflow fix.

This extends the fix from r17276 dealing with the removal of the DC
 skip-prevention flag in r17174.
If we allow SKIPing even when the cost is right near the maximum
 representable SSD, then the cost of other blocks can push it over
 the edge, causing us to randomly skip a block halfway through the

svn path=/trunk/theora/; revision=17959

7 years agoRemove the --disable-float configure option, and the corresponding
Ralph Giles [Tue, 3 May 2011 19:54:02 +0000 (19:54 +0000)]
Remove the --disable-float configure option, and the corresponding
THEORA_DISABLE_FLOAT C preprocessor symbol.

This originally disabled slow floating point code in the library,
but the critical path code has all been removed. It also used
to disable function of th_granule_time() which returns a double,
but it has not done so since prior to the 1.0 release, and there
have been no complaints.

It might be helpful to restore this option if it eliminated
the th_granule_time() API entry entirely, so that platforms
without native floating point don't have to link to an emulation
library, but in the absence of a request we prefer shorter code.

svn path=/trunk/theora/; revision=17951

7 years agoUpdate documentation for TH_ENCCTL_SET_BITRATE.
Tim Terriberry [Tue, 3 May 2011 01:48:58 +0000 (01:48 +0000)]
Update documentation for TH_ENCCTL_SET_BITRATE.

Make a note that passing 0 for the bitrate may not be guaranteed to
 return an error in future versions.

svn path=/trunk/theora/; revision=17949

8 years agoRemove an obsolete comment.
Ralph Giles [Fri, 25 Mar 2011 04:39:08 +0000 (04:39 +0000)]
Remove an obsolete comment.

The 'debian' subdirectory was removed from the dist target in r10741.

svn path=/trunk/theora/; revision=17914

8 years agoRemove the debian directory.
Tim Terriberry [Fri, 25 Mar 2011 04:33:30 +0000 (04:33 +0000)]
Remove the debian directory.

It's against Debian policy to keep this upstream, so neither we nor our
 packagers have maintained it in quite some time, and its presence simply
 confuses people.

svn path=/trunk/theora/; revision=17913

8 years agospec: Various typo fixes.
Tim Terriberry [Thu, 24 Mar 2011 21:05:20 +0000 (21:05 +0000)]
spec: Various typo fixes.

Thanks to Jonathan Fabrizio for the report.

svn path=/trunk/theora/; revision=17912

8 years agoUpdate ipr statement
lu_zero [Sun, 20 Mar 2011 23:01:09 +0000 (23:01 +0000)]
Update ipr statement

svn path=/trunk/theora/; revision=17902

8 years agospec: Update reference to MV decoding procedure.
Tim Terriberry [Thu, 17 Mar 2011 14:04:30 +0000 (14:04 +0000)]
spec: Update reference to MV decoding procedure.

The reference in the complete frame decode section was pointing to
 the procedure for decoding a single MV, rather than the following
 one for decoding all the MVs for a frame.
Thanks to Jonathan Fabrizio for the report.

svn path=/trunk/theora/; revision=17891

8 years agospec: Fix QRSIZES for the VP3 quantization parameters.
Tim Terriberry [Wed, 16 Mar 2011 15:04:05 +0000 (15:04 +0000)]
spec: Fix QRSIZES for the VP3 quantization parameters.

Thanks to Jonathan Fabrizio for the report.

svn path=/trunk/theora/; revision=17889

8 years agoFix a typo which prevented optional examples other than tiff2theora
Ralph Giles [Tue, 8 Mar 2011 21:02:03 +0000 (21:02 +0000)]
Fix a typo which prevented optional examples other than tiff2theora
to be built.

svn path=/trunk/theora/; revision=17883

8 years agoDocument the defaults for the defined bits of TH_ENCCTL_SET_RATE_FLAGS.
Ralph Giles [Tue, 1 Mar 2011 18:06:07 +0000 (18:06 +0000)]
Document the defaults for the defined bits of TH_ENCCTL_SET_RATE_FLAGS.

svn path=/trunk/theora/; revision=17876

8 years agoAdd NEON versions of the SATD functions.
Tim Terriberry [Thu, 24 Feb 2011 14:49:11 +0000 (14:49 +0000)]
Add NEON versions of the SATD functions.

This gives CIF encoding a 37.5% speed up on a Cortex A8.

svn path=/trunk/theora/; revision=17874

8 years agoTIFFReadRGBAImage doesn't actually return errors unless you ask it to.
Ralph Giles [Sun, 20 Feb 2011 06:15:01 +0000 (06:15 +0000)]
TIFFReadRGBAImage doesn't actually return errors unless you ask it to.

The final argument to TIFFReadRGBAImage is 'stopOnError'. That is,
if it's not true then the function will return success even if
loading the actual image data failed. As such, copying the example
code out of the documentation wasn't really what we wanted.

svn path=/trunk/theora/; revision=17856

8 years agoAdd a tiff2theora example.
Ralph Giles [Tue, 15 Feb 2011 19:45:59 +0000 (19:45 +0000)]
Add a tiff2theora example.

This is a modified version of png2theora, using libtiff
instead of libpng to read a sequence of tiff image files
and convert them to an Ogg Theora video.

Originally added because the Sintel film project was
giving us tiff frames and waiting for conversion to
png before encoding was tedious. In fact, it nearly
took longer than creating this program.

svn path=/trunk/theora/; revision=17844

8 years agoRemove trailing whitespace from some examples.
Ralph Giles [Tue, 15 Feb 2011 17:19:12 +0000 (17:19 +0000)]
Remove trailing whitespace from some examples.

svn path=/trunk/theora/; revision=17843

8 years agoClean up the front page of the API docs a bit.
Ralph Giles [Fri, 11 Feb 2011 01:40:45 +0000 (01:40 +0000)]
Clean up the front page of the API docs a bit.

I've always found two different API links for libtheoradec hard
to find on the main documentation page. This reformats them to
be more obvious, and shifts the emphasis further away from the
legacy api.

I've also added notes about which library to link with to the
API groups in codec.h.

svn path=/trunk/theora/; revision=17833

8 years agoRevert Makefile changes inadvertently included in the previous commit.
Ralph Giles [Fri, 11 Feb 2011 00:28:00 +0000 (00:28 +0000)]
Revert Makefile changes inadvertently included in the previous commit.

svn path=/trunk/theora/; revision=17832

8 years agoPrefer pdflatex and use batch mode when generating API docs.
Ralph Giles [Fri, 11 Feb 2011 00:25:49 +0000 (00:25 +0000)]
Prefer pdflatex and use batch mode when generating API docs.

We normally ask doxygen to generate latex source, but don't
actually run it through latex as part of the standard build.
If desired, a 'refman.pdf' can be created manually with
'make -C doc/libtheora/latex'.

Using latex+dvipdf turns out not to work, and pdflatex generally
does a better job anyway.

svn path=/trunk/theora/; revision=17831

8 years agoMerge the duplicate HTML_TIMESTAMP entry added by doxygen -u
Ralph Giles [Fri, 11 Feb 2011 00:22:05 +0000 (00:22 +0000)]
Merge the duplicate HTML_TIMESTAMP entry added by doxygen -u
in the previous commit.

svn path=/trunk/theora/; revision=17830

8 years agoUpdate the doxygen config file to version 1.7.1.
Ralph Giles [Fri, 11 Feb 2011 00:10:49 +0000 (00:10 +0000)]
Update the doxygen config file to version 1.7.1.

svn path=/trunk/theora/; revision=17829

8 years agoUpdate documenation to reflect --enable-docs being the default.
Ralph Giles [Thu, 10 Feb 2011 22:55:47 +0000 (22:55 +0000)]
Update documenation to reflect --enable-docs being the default.

We try to build the doxygen api documentation if the tool is
available, so it's more appropriate to document this option
as a --disable than an --enable.

svn path=/trunk/theora/; revision=17828

8 years agoRemove a duplicate dependency.
Ralph Giles [Thu, 10 Feb 2011 22:15:33 +0000 (22:15 +0000)]
Remove a duplicate dependency.

spec.bib was already in $(SPEC_SRCS) and doesn't need to be
listed explicitly.

svn path=/trunk/theora/; revision=17827

8 years agoFix ARM build breakage from r17822.
Tim Terriberry [Thu, 10 Feb 2011 19:23:26 +0000 (19:23 +0000)]
Fix ARM build breakage from r17822.

svn path=/trunk/theora/; revision=17825

8 years agoAdd gmaxwell to the AUTHORS list.
Ralph Giles [Thu, 10 Feb 2011 19:19:25 +0000 (19:19 +0000)]
Add gmaxwell to the AUTHORS list.

svn path=/trunk/theora/; revision=17824

8 years agoRemove some trailing whitespace in documentation.
Ralph Giles [Thu, 10 Feb 2011 19:17:43 +0000 (19:17 +0000)]
Remove some trailing whitespace in documentation.

svn path=/trunk/theora/; revision=17823

8 years agoUpdate to exclude generated ARM .S files from distribution.
Tim Terriberry [Thu, 10 Feb 2011 18:33:25 +0000 (18:33 +0000)]
Update to exclude generated ARM .S files from distribution.

svn path=/trunk/theora/; revision=17822

8 years agoAdd a new speed level between the old levels 2 and 3.
Ralph Giles [Wed, 9 Feb 2011 22:08:34 +0000 (22:08 +0000)]
Add a new speed level between the old levels 2 and 3.

This change inserts a new speed level OC_SP_LEVEL_NOSATD (3)
(now 4). The new speed level further accelerates analysis by
using the cheaper SAD (sum of absolute differences) metric
for measuring distortion instead of the more expensive SATD
(sum of absolute transformed differences).

The new level is intermediate in both quality and encoding
speed between the adjacent speed levels, allowing smoother
adaptation to realtime encoding contraints. In particular
it's much closer to realtime 720p30 on current Core2 cpus.

The cheaper SAD metric is now also used for the fastest NOMC
speed level. This is a reduction in quality for this speed level
as well, but it also about 10% faster. Since the NOMC mode is
already very poor quality, used as a last resort when performance
is critical, we deemed this a better option than adding a further
NOMC_SATD mode or keeping the old NOMC behaviour.

To support the new speed level, parallel copies of the OC_MODE_RD
table are kept, one for each metric. The encoder context keeps
track of which on to use based ont eh current speed level. Analysis
code chooses which metric to calculate and use on the fly. The extra
conditionals did not measurably affect encoding time in benchmarks.

The metrics collection and fitting code used to generate modedec.h
is also updated to track both SAD and SATD measurements.

Thanks to Tim Terriberry and Greg Maxwell for their comments and
and contributions in reviewing this patch. The implementation
of oc_enc_frag_intra_sad is based on one from earlier development
work by Greg Maxwell.

svn path=/trunk/theora/; revision=17821

8 years agoPrint summary timing information at the end of encoder_example runs.
Ralph Giles [Wed, 9 Feb 2011 01:45:41 +0000 (01:45 +0000)]
Print summary timing information at the end of encoder_example runs.

This is helpful for casual benchmarking and performance comparision.
We use the very portable time.h clock() call and the beginning and
end of the main function and calculate the average rate in millions
of pixels per second and fraction of realtime. Unfortunately clock()
isn't accurate enough to be useful for per-frame statistics.

svn path=/trunk/theora/; revision=17820

8 years agoUpdate the noop test programmes for the additional th_info validation
Ralph Giles [Wed, 9 Feb 2011 01:30:11 +0000 (01:30 +0000)]
Update the noop test programmes for the additional th_info validation
added in c17760.

svn path=/trunk/theora/; revision=17819

8 years agoRemove trailing whitespace in the public headers.
Ralph Giles [Thu, 20 Jan 2011 23:00:15 +0000 (23:00 +0000)]
Remove trailing whitespace in the public headers.

svn path=/trunk/theora/; revision=17787

8 years agoThe yoffset calculation in oc_dec_init_dummy_frame was incorrect.
Tim Terriberry [Sat, 15 Jan 2011 02:01:47 +0000 (02:01 +0000)]
The yoffset calculation in oc_dec_init_dummy_frame was incorrect.

This was only used when a stream started without a keyframe, and was
 initializing the wrong region of memory.
This was harmless (the region it initialized was still safely
 allocated, it just didn't cover all of the frame we wanted to use
 as a reference frame), but lead to unpredictable results and
 valgrind errors.

svn path=/trunk/theora/; revision=17780

8 years agoFixed project configuration which referenced two CRT versions in output binaries.
Cristian Adam [Sun, 9 Jan 2011 21:38:21 +0000 (21:38 +0000)]
Fixed project configuration which referenced two CRT versions in output binaries.

svn path=/trunk/theora/; revision=17771

8 years agoUpdate the libtheora_info example for the previous commit.
Ralph Giles [Thu, 16 Dec 2010 19:10:07 +0000 (19:10 +0000)]
Update the libtheora_info example for the previous commit.

This example program allocates a minimal encoder context so
it can query settings through th_encode_ctl(). As of r17760
setting the framerate to a non-zero/zero value is required.

svn path=/trunk/theora/; revision=17761

8 years agoReject th_info structs with a zero in the frame rate rational.
Ralph Giles [Thu, 16 Dec 2010 18:57:36 +0000 (18:57 +0000)]
Reject th_info structs with a zero in the frame rate rational.

The specification says that the frame rate numerator and
denominator MUST both be greater than zero. This wasn't
checked as part of the structure validation code, and in
fact passing a zero value here caused a segfault.

The code now checks for this in oc_state_init() and returns
TH_EINVAL, which is causes th_encode_alloc() and oc_decode_alloc()
to return NULL.

A check for that NULL return is also added to encoder_example.c
to show that it may fail when an invalid th_info parameter is

svn path=/trunk/theora/; revision=17760

8 years agoBuild fix on Solaris 11. __GNUC_PREREQ was not defined in mathops.h when compiling...
Gregory Maxwell [Tue, 14 Dec 2010 06:47:39 +0000 (06:47 +0000)]
Build fix on Solaris 11. __GNUC_PREREQ was not defined in mathops.h when compiling mathops.c.

svn path=/trunk/theora/; revision=17756

8 years agoMake the SATD functions return the signed DC value instead of abs(dc).
Tim Terriberry [Tue, 14 Dec 2010 03:07:41 +0000 (03:07 +0000)]
Make the SATD functions return the signed DC value instead of abs(dc).

Right now we still immediately compute abs(dc), but we will need the signed
 value to do real DC costing.
This commit should not change the output of the encoder.

svn path=/trunk/theora/; revision=17755

8 years agoUpdate SConstruct to pass -lm when building with collect_metrics=1.
Ralph Giles [Mon, 13 Dec 2010 18:38:40 +0000 (18:38 +0000)]
Update SConstruct to pass -lm when building with collect_metrics=1.

svn path=/trunk/theora/; revision=17753

8 years agoMake emit only one line per input line, if possible.
Tim Terriberry [Mon, 13 Dec 2010 15:20:34 +0000 (15:20 +0000)]
Make emit only one line per input line, if possible.

The changes in r17745 made PROC and ENDP directives emit multiple
 lines, leading to mis-matched line numbers between the original RVCT
 source and the GNU translation.
gas allows multiple statements per line, so use them to keep the line
 numbers in sync.
Also, contrary to the commit message in r17745, function names actually
 do show up correctly in valgrind; I was testing the wrong binary.

svn path=/trunk/theora/; revision=17752

8 years agoFormatting clean-up for oc_enc_quantize_neon().
Tim Terriberry [Mon, 13 Dec 2010 14:34:27 +0000 (14:34 +0000)]
Formatting clean-up for oc_enc_quantize_neon().
Also knock another instruction off the PMOVMSKB emulation.

svn path=/trunk/theora/; revision=17751

8 years agoCorrect two small mistakes in r17749.
Tim Terriberry [Mon, 13 Dec 2010 07:03:07 +0000 (07:03 +0000)]
Correct two small mistakes in r17749.

The wrong offset was being used for the shift factor in
 oc_enc_enquant_table_fixup_neon(), and the wrong value was being returned from
 oc_enc_quantize_neon() when the entire block was quantized to zero.

svn path=/trunk/theora/; revision=17750

8 years agoAdd a NEON version of oc_enc_quantize().
Tim Terriberry [Mon, 13 Dec 2010 06:27:49 +0000 (06:27 +0000)]
Add a NEON version of oc_enc_quantize().

svn path=/trunk/theora/; revision=17749

8 years agoMake PROC and ENDP functional in
Tim Terriberry [Fri, 10 Dec 2010 22:11:00 +0000 (22:11 +0000)]
Make PROC and ENDP functional in

PROC now marks the corresponding symbol as a function, and ENDP emits
 an appropriate .size directive for it.
These should help tools identify these functions, though valgrind still
 can't associate the function name with the corresponding code.

svn path=/trunk/theora/; revision=17745

8 years agoAlso silence the input file summary lines with -q.
Ralph Giles [Thu, 9 Dec 2010 20:21:36 +0000 (20:21 +0000)]
Also silence the input file summary lines with -q.

I'd found these helpful for script debugging, but really it's
better for scripts to print their own version of this information.
The -q option should really mean no non-error output.

svn path=/trunk/theora/; revision=17744

8 years agoFixed a VisualC asm specific bug.
Cristian Adam [Tue, 7 Dec 2010 17:26:27 +0000 (17:26 +0000)]
Fixed a VisualC asm specific bug.
Removed _BIND_TO_CURRENT_CRT_VERSION preprocessor directive for VS2008 project files.
Now debug version of dump_video and encoder_example work.

svn path=/trunk/theora/; revision=17739

8 years agoProperly initialize the DCT scratch space.
Tim Terriberry [Tue, 7 Dec 2010 17:10:07 +0000 (17:10 +0000)]
Properly initialize the DCT scratch space.

r17728 now expects this to be cleared to zero before entering
 oc_enc_block_transform_quantize(), but we weren't doing so.

svn path=/trunk/theora/; revision=17738

8 years agoFix MSVC compilation broken in r17736.
Tim Terriberry [Tue, 7 Dec 2010 16:21:56 +0000 (16:21 +0000)]
Fix MSVC compilation broken in r17736.

It helps to actually rename the function after changing its declaration.

svn path=/trunk/theora/; revision=17737

8 years agoMinor fix-ups to r17728.
Tim Terriberry [Tue, 7 Dec 2010 14:13:55 +0000 (14:13 +0000)]
Minor fix-ups to r17728.

Convert references to the stack buffer in the MMX fDCT to use esp-relative
 offsets, saving a register.
Move the MSVC MMX fDCT into the MMXEXT section (as was done for the gcc one),
 since it now requires pshufw for the zig-zagging.

svn path=/trunk/theora/; revision=17736

8 years agoFixed one GCC to Visual C asm instruction call. Now the optimized version produces...
Cristian Adam [Tue, 7 Dec 2010 11:17:40 +0000 (11:17 +0000)]
Fixed one GCC to Visual C asm instruction call. Now the optimized version produces the same output as the C version.

svn path=/trunk/theora/; revision=17734

8 years agoMove zig-zagging from quantization into the fDCT.
Tim Terriberry [Tue, 7 Dec 2010 10:28:07 +0000 (10:28 +0000)]
Move zig-zagging from quantization into the fDCT.

This removes one of the transposes from the fDCT, and avoids several zig-zag
 lookups during tokenization.
This change also makes the encoder iDCT clear the input buffer like the
 decoder, which can be re-used for the next block, avoiding the need for a
 memcpy or memset in the tokenizer.
This gives a 1.3% speed-up at the default speed-level (1), and a 3.1% speed-up
 at speed-level 2 (for 480p, on x86-64).

svn path=/trunk/theora/; revision=17728

8 years agoAdd a new libtheora_info example program.
Ralph Giles [Thu, 2 Dec 2010 19:28:11 +0000 (19:28 +0000)]
Add a new libtheora_info example program.

This program shows how to query a few version-dependent library
paramenters, such as the vendor string and maximum speed level,
and prints a summary to stdout in 'header: value' format.

I mostly wanted this as a utility to get the maximum speed level
for benchmark scripts, but thought it structuring it as an example
was better than stuffing it in tools.

It would be reasonable to extend this to return decoder parameters
like the maximum preprocessing level.

svn path=/trunk/theora/; revision=17709

8 years agoEnable svn keyword expansion of eol-adjustment on dump_psnr.c
Ralph Giles [Thu, 2 Dec 2010 19:22:04 +0000 (19:22 +0000)]
Enable svn keyword expansion of eol-adjustment on dump_psnr.c

svn path=/trunk/theora/; revision=17708

8 years agoRemove an extra space in the file header.
Ralph Giles [Thu, 2 Dec 2010 18:46:32 +0000 (18:46 +0000)]
Remove an extra space in the file header.

svn path=/trunk/theora/; revision=17707

8 years agoAdd a build variable collect_metrics to the scons build.
Ralph Giles [Tue, 30 Nov 2010 19:32:31 +0000 (19:32 +0000)]
Add a build variable collect_metrics to the scons build.

Invoking the build with 'scons collect_metrics=1' will
compile the library -DOC_COLLECT_METRICS, which enables
recording training metrics.

svn path=/trunk/theora/; revision=17692

8 years agoAdd a -q option to encoder_example to silence progress messages.
Ralph Giles [Thu, 25 Nov 2010 21:20:07 +0000 (21:20 +0000)]
Add a -q option to encoder_example to silence progress messages.

This makes it a little nice to call from a batch job with parallel
executation. The messages indentifying the input file parameters
and error messages are still printed.

svn path=/trunk/theora/; revision=17660

8 years agoMake input parameter_intra_satd const, ACKed by derf.
oggk [Thu, 25 Nov 2010 15:23:36 +0000 (15:23 +0000)]
Make input parameter_intra_satd const, ACKed by derf.

svn path=/trunk/theora/; revision=17649

8 years agoFix out-of-date OC_ARM_ASM_ARMV6 usage.
Tim Terriberry [Wed, 24 Nov 2010 21:11:47 +0000 (21:11 +0000)]
Fix out-of-date OC_ARM_ASM_ARMV6 usage.

This was ultimately named OC_ARM_ASM_MEDIA instead.
It shouldn't have mattered in this case, as it shouldn't be possible to get
 OC_ARM_ASM_MEDIA without OC_ARM_ASM_EDSP, but clean it up anyway.

svn path=/trunk/theora/; revision=17646

8 years agoRename OC_SAD_SHIFT to OC_SATD_SHIFT.
Ralph Giles [Wed, 24 Nov 2010 20:51:36 +0000 (20:51 +0000)]

The SAD and SADT metrics have different ranges, so it is
necessary to use different scale factors when comparing

Originally we used SAD, and when SATD was added, the
scale factor was updated without changing the name.
This commit finally does so. However, it is intended
that the code switch back to the SAD metric at higher
speed levels, we also keep OC_SAD_SHIFT with its
appropriate value, 6 according to Tim.

Likewise, OC_SAD_BINS is renamed OC_COMP_BINS in
expectation of supporting mode tables for both

svn path=/trunk/theora/; revision=17645

8 years agoDocument that the th_*_ctl() return values are specific
Ralph Giles [Mon, 22 Nov 2010 20:55:49 +0000 (20:55 +0000)]
Document that the th_*_ctl() return values are specific
to the control codes passed.

svn path=/trunk/theora/; revision=17639

8 years agoCorrect a typo in the usage documentation.
Ralph Giles [Thu, 18 Nov 2010 17:18:43 +0000 (17:18 +0000)]
Correct a typo in the usage documentation.

Thanks to Basil Gohar for pointing this out.

svn path=/trunk/theora/; revision=17632

8 years agoDon't change the block qii flags if no ac coefficients will be coded in the selected...
Gregory Maxwell [Tue, 9 Nov 2010 02:43:37 +0000 (02:43 +0000)]
Don't change the block qii flags if no ac coefficients will be coded in the selected mode. The code previously tried to do this but failed, instead it desynchronized the qii costing with the coded flags. 0.065dB SSIM improvement on 312kbit/sec foreman_cif.y4m.

svn path=/trunk/theora/; revision=17624

8 years ago#define __GNUC_PREREQ ourselves.
Tim Terriberry [Fri, 29 Oct 2010 04:21:26 +0000 (04:21 +0000)]
#define __GNUC_PREREQ ourselves.

On non-glibc systems (Android), the system headers won't do it for us.
This also simplifies its use, since we can guarantee it's always #define'd
 (i.e., as 0 on non-gcc builds).

svn path=/trunk/theora/; revision=17578

8 years agoPrevent double free on codebook unpacking failure.
Tim Terriberry [Fri, 29 Oct 2010 04:00:07 +0000 (04:00 +0000)]
Prevent double free on codebook unpacking failure.

svn path=/trunk/theora/; revision=17577

8 years agoWarning fixes.
Tim Terriberry [Fri, 29 Oct 2010 01:07:51 +0000 (01:07 +0000)]
Warning fixes.

Signed/unsigned comparison and integer conversion overflow.

svn path=/trunk/theora/; revision=17576

8 years agoMore include fixes.
Tim Terriberry [Fri, 29 Oct 2010 00:41:16 +0000 (00:41 +0000)]
More include fixes.

sse2trans.h was including encoder headers, when it can be used by the decoder

svn path=/trunk/theora/; revision=17575

8 years agoTwo minor fixes.
Tim Terriberry [Fri, 29 Oct 2010 00:32:55 +0000 (00:32 +0000)]
Two minor fixes.

sse2idct.c was needlessly including x86enc.h when it is part of the decoder.
collect.c had a trailing space.

svn path=/trunk/theora/; revision=17574

8 years agoFix some C64x compiler warnings.
Tim Terriberry [Mon, 25 Oct 2010 21:17:23 +0000 (21:17 +0000)]
Fix some C64x compiler warnings.

Remove a few unused variables (that were assigned to, but never used), and
 add an explicit cast to convert -OC_LOTS_OF_BITS to unsigned, since the C64x
 compiler complains about the sign change (arguably rightly so).

svn path=/trunk/theora/; revision=17565

8 years agoAdd c64x changes for r17563, as they were accidentally omitted.
Tim Terriberry [Mon, 25 Oct 2010 21:11:10 +0000 (21:11 +0000)]
Add c64x changes for r17563, as they were accidentally omitted.

svn path=/trunk/theora/; revision=17564

8 years agoEnsure frame rows are 16-byte aligned.
Tim Terriberry [Mon, 25 Oct 2010 17:40:54 +0000 (17:40 +0000)]
Ensure frame rows are 16-byte aligned.

We don't actually use this for anything yet, but it may help calling
 applications (e.g., doing software YUV2RGB conversion).
Also, change ref_frame_data to point directly to the desired reference frame,
 rather than require a lookup through ref_frame_idx first.
This saves an indirection and gives a 0.7% speed-up at 720p on a Cortex A8.
It should have an even bigger benefit on C64x, though it wasn't benchmarked

svn path=/trunk/theora/; revision=17563

8 years agoRemoved Windows CE Platform Builder as a dependency of building Windows Mobile binaries.
Cristian Adam [Wed, 20 Oct 2010 21:48:27 +0000 (21:48 +0000)]
Removed Windows CE Platform Builder as a dependency of building Windows Mobile binaries.

svn path=/trunk/theora/; revision=17550

8 years agomcenc.c: Skip the 4MV SATD in speed level 2. 2% speedup. Avoid duplicating the...
Gregory Maxwell [Wed, 13 Oct 2010 15:15:19 +0000 (15:15 +0000)]
mcenc.c: Skip the 4MV SATD in speed level 2.  2% speedup.  Avoid duplicating the first set b candidate (correctly adding the surrounding accelerators hurt efficiency).

svn path=/trunk/theora/; revision=17507

8 years agoImprove MV predictor computations.
Tim Terriberry [Wed, 13 Oct 2010 02:52:41 +0000 (02:52 +0000)]
Improve MV predictor computations.

This removes some useless clamping and only computes set B predictors when
 they're actually going to be used.

svn path=/trunk/theora/; revision=17506

8 years agoAvoid harmless Coverity warning in oc_sb_create_plane_mapping().
Tim Terriberry [Tue, 12 Oct 2010 19:56:11 +0000 (19:56 +0000)]
Avoid harmless Coverity warning in oc_sb_create_plane_mapping().

Coverity thinks we're overrunning this static array by passing it to memset.
In reality, it's a multidimensional array, and guaranteed to be contiguous, but
 we might as well silence this warning.
Reported in

svn path=/trunk/theora/; revision=17505

8 years agoName C version of oc_huff_token_decode properly.
Tim Terriberry [Tue, 12 Oct 2010 18:59:45 +0000 (18:59 +0000)]
Name C version of oc_huff_token_decode properly.

This should have had a _c suffix, which r17503 exposed.

svn path=/trunk/theora/; revision=17504

8 years agoPull in internal.h (for config.h) from bitpack.h.
Tim Terriberry [Tue, 12 Oct 2010 13:38:16 +0000 (13:38 +0000)]
Pull in internal.h (for config.h) from bitpack.h.

This is needed to get OC_ARM_ASM, so the C bitpacking routines don't get used
 during header parsing.

svn path=/trunk/theora/; revision=17503

8 years agoRemove a debug printf from parse_time.
Ralph Giles [Fri, 8 Oct 2010 18:42:04 +0000 (18:42 +0000)]
Remove a debug printf from parse_time.

svn path=/trunk/theora/; revision=17495

8 years agoFix a comment typo.
Ralph Giles [Fri, 8 Oct 2010 16:39:54 +0000 (16:39 +0000)]
Fix a comment typo.

svn path=/trunk/theora/; revision=17494

8 years agoAdd PROC/ENDP markings to the ARM asm (currently ignored by the GNU toolchain).
Tim Terriberry [Sun, 3 Oct 2010 22:49:42 +0000 (22:49 +0000)]
Add PROC/ENDP markings to the ARM asm (currently ignored by the GNU toolchain).
Also slightly simplify the MB mode and MV decoding.
The new code uses slightly less cache and fewer lookups.

svn path=/trunk/theora/; revision=17481

8 years agoAdd x86 assembly files to the libtheoraenc and libtheoradec
Ralph Giles [Tue, 28 Sep 2010 18:52:07 +0000 (18:52 +0000)]
Add x86 assembly files to the libtheoraenc and libtheoradec
static library targets in the XCode build.

svn path=/trunk/theora/; revision=17473

8 years agoFix win32 bustage created by r17457.
Tim Terriberry [Fri, 24 Sep 2010 23:01:08 +0000 (23:01 +0000)]
Fix win32 bustage created by r17457.

Thanks to Cristian Adam for the report.

svn path=/trunk/theora/; revision=17467

8 years agoFix typos. Thanks to Maik Merten for pointing these out.
Ralph Giles [Fri, 24 Sep 2010 08:29:54 +0000 (08:29 +0000)]
Fix typos. Thanks to Maik Merten for pointing these out.

svn path=/trunk/theora/; revision=17465

8 years agoUpdate the README for the 1.2 releases.
Ralph Giles [Fri, 24 Sep 2010 08:17:50 +0000 (08:17 +0000)]
Update the README for the 1.2 releases.

svn path=/trunk/theora/; revision=17464

8 years agoBump version strings post-release.
Ralph Giles [Fri, 24 Sep 2010 07:58:29 +0000 (07:58 +0000)]
Bump version strings post-release.

svn path=/trunk/theora/; revision=17463

8 years agoAdd a summary of changes for the 1.2.0alpha1 release.
Ralph Giles [Fri, 24 Sep 2010 07:56:48 +0000 (07:56 +0000)]
Add a summary of changes for the 1.2.0alpha1 release.

Unfortunately, I didn't do this before actually making the release.

svn path=/trunk/theora/; revision=17462

8 years agoCache the reference frame associated with the current MB mode in each fragment.
Tim Terriberry [Fri, 24 Sep 2010 02:05:49 +0000 (02:05 +0000)]
Cache the reference frame associated with the current MB mode in each fragment.

This avoids repeatedly performing the MB mode -> reference frame translation,
 which is done many times per fragment during DC prediction.
In fact, by using a special OC_FRAME_NONE tag for uncoded fragments, one need
 not even check to see if a fragment is coded during DC prediction, simplifying
 it even more.
This saves 2% on 720p decode on a Cortex A8.

svn path=/trunk/theora/; revision=17457

8 years agoRestore the old automake options in a comment.
Tim Terriberry [Thu, 23 Sep 2010 23:13:52 +0000 (23:13 +0000)]
Restore the old automake options in a comment.

This makes it easier for me to switch back to them in places that don't support
 automake 1.11 yet.

svn path=/trunk/theora/; revision=17456

8 years agoUpdated Visual Studio project files. v1.2.0alpha1
Cristian Adam [Thu, 23 Sep 2010 21:50:57 +0000 (21:50 +0000)]
Updated Visual Studio project files.

svn path=/trunk/theora/; revision=17452

8 years agoBump the library and package versioning for the 1.2 release.
Ralph Giles [Thu, 23 Sep 2010 20:30:53 +0000 (20:30 +0000)]
Bump the library and package versioning for the 1.2 release.

svn path=/trunk/theora/; revision=17449