GNOME Bugzilla – Bug 594165
[theoraenc] Implement support for new formats
Last modified: 2009-09-09 14:47:30 UTC
The new upcoming release of Theora will support the Y444 and Y42B formats in addition to I420. The attached patches implement this. The only thing they don't do yet is restrict the advertised sinkcaps when an older libtheora is used. I wasn't sure if this should be solved by using a different template caps or by using a getcaps function.
Created attachment 142495 [details] [review] theora: Add assertions that functions don't fail Some functions in libtheora can return an error, but that error cannot ever happen inside theoraenc. In those cases assert that it doesn't.
Created attachment 142497 [details] [review] theora: Split out buffer resize in its own function
Created attachment 142498 [details] [review] theora: Split yuv_buffer creation into its own function
Created attachment 142499 [details] [review] theora: Refactor the buffer copy code
Created attachment 142500 [details] [review] theora: Implement support in theoraenc for Y444 and Y42B
Created attachment 142629 [details] [review] theora: Check supported input formats in getcaps function We want to fail early when an older libtheora release is used that does not support Y444 or Y42B formats, so use a getcaps function that does this.
Tim suggested using gstvideo functions for computing component strides and sizes. However, the theora code uses slightly different formulas in some places - most noticably component height where it doesn't round up. This changes the visible output when encoding with odd width or height, so I decided to not do that.
Thanks for splitting the changes into many small chunks, this made reviewing really easy and fast :) commit d9c98527640e007c8ac04696a028555dd7df279c Author: Benjamin Otte <otte@gnome.org> Date: Mon Sep 7 17:29:38 2009 +0200 theora: Check supported input formats in getcaps function We want to fail early when an older libtheora release is used that does not support Y444 or Y42B formats, so use a getcaps function that does this. commit aa46e56170b58a3cd9936ef14b824b4ee11a63f2 Author: Benjamin Otte <otte@gnome.org> Date: Fri Sep 4 21:37:04 2009 +0200 theora: Implement support in theoraenc for Y444 and Y42B Fixes bug #594165. commit 96388221cf8fc56072731f034e9a1c8ff1c01c0e Author: Benjamin Otte <otte@gnome.org> Date: Fri Sep 4 20:23:52 2009 +0200 theora: Refactor the buffer copy code commit bac05fbf6f07cc645e730d4fae8f9c3ae6a01e82 Author: Benjamin Otte <otte@gnome.org> Date: Fri Sep 4 16:59:49 2009 +0200 theora: Split yuv_buffer creation into its own function commit c1ead16f710378bdcf3829dd5baedb560cc8a350 Author: Benjamin Otte <otte@gnome.org> Date: Fri Sep 4 16:49:08 2009 +0200 theora: Split out buffer resize in its own function commit 9d4f72f2faca7ee4793870e52d62d99a87b47f36 Author: Benjamin Otte <otte@gnome.org> Date: Fri Sep 4 14:06:09 2009 +0200 theora: Add assertions that functions don't fail Some functions in libtheora can return an error, but that error cannot ever happen inside theoraenc. In those cases assert that it doesn't.