cehoyos | 1 Jul 01:01 2010
Picon

r23919 - trunk/libavformat/utils.c

Author: cehoyos
Date: Thu Jul  1 01:01:44 2010
New Revision: 23919

Log:
Make "invalid dts/pts combination" a debug instead of a warning message.

Patch by XBMC

Modified:
   trunk/libavformat/utils.c

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	Thu Jul  1 00:39:13 2010	(r23918)
+++ trunk/libavformat/utils.c	Thu Jul  1 01:01:44 2010	(r23919)
 <at>  <at>  -908,7 +908,7  <at>  <at>  static void compute_pkt_fields(AVFormatC
     // we take the conservative approach and discard both
     // Note, if this is misbehaving for a H.264 file then possibly presentation_delayed is not set correctly.
     if(delay==1 && pkt->dts == pkt->pts && pkt->dts != AV_NOPTS_VALUE && presentation_delayed){
-        av_log(s, AV_LOG_WARNING, "invalid dts/pts combination\n");
+        av_log(s, AV_LOG_DEBUG, "invalid dts/pts combination\n");
         pkt->dts= pkt->pts= AV_NOPTS_VALUE;
     }
darkshikari | 1 Jul 01:15 2010
Picon

r23920 - trunk/libavcodec/vp56.h

Author: darkshikari
Date: Thu Jul  1 01:15:25 2010
New Revision: 23920

Log:
Optimize vp56 arithmetic decoder
Negate "bits" to eliminate a negate in cache refilling.

Modified:
   trunk/libavcodec/vp56.h

Modified: trunk/libavcodec/vp56.h
==============================================================================
--- trunk/libavcodec/vp56.h	Thu Jul  1 01:01:44 2010	(r23919)
+++ trunk/libavcodec/vp56.h	Thu Jul  1 01:15:25 2010	(r23920)
 <at>  <at>  -48,7 +48,8  <at>  <at>  typedef int  (*VP56ParseHeader)(VP56Cont

 typedef struct {
     int high;
-    int bits;
+    int bits; /* Stored negated (i.e. negative "bits" is a positive number of bits left)
+               * in order to eliminate a negate in cache refilling */
     const uint8_t *buffer;
     const uint8_t *end;
     unsigned long code_word;
 <at>  <at>  -185,7 +186,7  <at>  <at>  static inline void vp56_init_range_decod
                                            const uint8_t *buf, int buf_size)
 {
     c->high = 255;
-    c->bits = 8;
(Continue reading)

darkshikari | 1 Jul 01:18 2010
Picon

r23921 - trunk/libavcodec/vp56.h

Author: darkshikari
Date: Thu Jul  1 01:18:47 2010
New Revision: 23921

Log:
CMOV-ify vp56 arithcoder
This incantation causes gcc 4.3 to generate cmov on x86, a vastly better option
than a completely unpredictable branch.
Hopefully this carries over to newer versions and other CPUs with conditionals.
~5 cycles saved per call on a Core i7.

Modified:
   trunk/libavcodec/vp56.h

Modified: trunk/libavcodec/vp56.h
==============================================================================
--- trunk/libavcodec/vp56.h	Thu Jul  1 01:15:25 2010	(r23920)
+++ trunk/libavcodec/vp56.h	Thu Jul  1 01:18:47 2010	(r23921)
 <at>  <at>  -199,12 +199,8  <at>  <at>  static inline int vp56_rac_get_prob(VP56
     int bit = c->code_word >= low_shift;
     int shift;

-    if (bit) {
-        c->high -= low;
-        c->code_word -= low_shift;
-    } else {
-        c->high = low;
-    }
+    c->high = bit ? c->high - low : low;
+    c->code_word = bit ? c->code_word - low_shift : c->code_word;
(Continue reading)

Reimar Döffinger | 1 Jul 01:41 2010
Picon
Picon

Re: r23921 - trunk/libavcodec/vp56.h

On Thu, Jul 01, 2010 at 01:18:47AM +0200, darkshikari wrote:
> Author: darkshikari
> Date: Thu Jul  1 01:18:47 2010
> New Revision: 23921
> 
> Log:
> CMOV-ify vp56 arithcoder
> This incantation causes gcc 4.3 to generate cmov on x86, a vastly better option
> than a completely unpredictable branch.
> Hopefully this carries over to newer versions and other CPUs with conditionals.
> ~5 cycles saved per call on a Core i7.

Nice, I actually tried to make a branchless variant using a mask etc, unfortunately
it needs so many additional instructions that it ended up being the same speed.

> +    c->high = bit ? c->high - low : low;
> +    c->code_word = bit ? c->code_word - low_shift : c->code_word;

Does the compiler "get" that
bit == !((c->high - low) >> 31)
not sure that actually is any faster to calculate, but what the
compiler did looked rather bad to me...
stefano | 1 Jul 01:52 2010
Picon

r23922 - trunk/libavfilter/vf_pad.c

Author: stefano
Date: Thu Jul  1 01:52:26 2010
New Revision: 23922

Log:
Improve description for the pad filter.

Modified:
   trunk/libavfilter/vf_pad.c

Modified: trunk/libavfilter/vf_pad.c
==============================================================================
--- trunk/libavfilter/vf_pad.c	Thu Jul  1 01:18:47 2010	(r23921)
+++ trunk/libavfilter/vf_pad.c	Thu Jul  1 01:52:26 2010	(r23922)
 <at>  <at>  -306,7 +306,7  <at>  <at>  static void draw_slice(AVFilterLink *lin

 AVFilter avfilter_vf_pad = {
     .name          = "pad",
-    .description   = "Add pads to the input image.",
+    .description   = "Add paddings to the input image.",

     .priv_size     = sizeof(PadContext),
     .init          = init,
stefano | 1 Jul 01:52 2010
Picon

r23923 - trunk/libavfilter/vf_pad.c

Author: stefano
Date: Thu Jul  1 01:52:28 2010
New Revision: 23923

Log:
Set pad description with NULL_IF_CONFIG_SMALL(), consistent with the
other filters.

Modified:
   trunk/libavfilter/vf_pad.c

Modified: trunk/libavfilter/vf_pad.c
==============================================================================
--- trunk/libavfilter/vf_pad.c	Thu Jul  1 01:52:26 2010	(r23922)
+++ trunk/libavfilter/vf_pad.c	Thu Jul  1 01:52:28 2010	(r23923)
 <at>  <at>  -306,7 +306,7  <at>  <at>  static void draw_slice(AVFilterLink *lin

 AVFilter avfilter_vf_pad = {
     .name          = "pad",
-    .description   = "Add paddings to the input image.",
+    .description   = NULL_IF_CONFIG_SMALL("Add paddings to the input image."),

     .priv_size     = sizeof(PadContext),
     .init          = init,
darkshikari | 1 Jul 01:59 2010
Picon

r23924 - trunk/libavcodec/vp56.h

Author: darkshikari
Date: Thu Jul  1 01:59:27 2010
New Revision: 23924

Log:
Eliminate another redundant instruction in vp56/8 arithcoder
Necessary because of this GCC bug:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44474
To do this, convert some, but not all (!) of the variables in VP56RangeCoder
into local variables.
If we convert c->high into a local variable, gcc gets the stupids and refuses
to use a conditional move for the unpredictable main branch.

TODO: dispense with this bullshit and write an asm version.

Modified:
   trunk/libavcodec/vp56.h

Modified: trunk/libavcodec/vp56.h
==============================================================================
--- trunk/libavcodec/vp56.h	Thu Jul  1 01:52:28 2010	(r23923)
+++ trunk/libavcodec/vp56.h	Thu Jul  1 01:59:27 2010	(r23924)
 <at>  <at>  -194,23 +194,32  <at>  <at>  static inline void vp56_init_range_decod

 static inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob)
 {
+    /* Don't put c->high in a local variable; if we do that, gcc gets
+     * the stupids and turns the code below into a branch again. */
+    int bits = c->bits;
+    unsigned long code_word = c->code_word;
(Continue reading)

Jason Garrett-Glaser | 1 Jul 02:00 2010
Picon

Re: r23921 - trunk/libavcodec/vp56.h

On Wed, Jun 30, 2010 at 4:41 PM, Reimar Döffinger
<Reimar.Doeffinger <at> gmx.de> wrote:
> On Thu, Jul 01, 2010 at 01:18:47AM +0200, darkshikari wrote:
>> Author: darkshikari
>> Date: Thu Jul  1 01:18:47 2010
>> New Revision: 23921
>>
>> Log:
>> CMOV-ify vp56 arithcoder
>> This incantation causes gcc 4.3 to generate cmov on x86, a vastly better option
>> than a completely unpredictable branch.
>> Hopefully this carries over to newer versions and other CPUs with conditionals.
>> ~5 cycles saved per call on a Core i7.
>
> Nice, I actually tried to make a branchless variant using a mask etc, unfortunately
> it needs so many additional instructions that it ended up being the same speed.
>
>> +    c->high = bit ? c->high - low : low;
>> +    c->code_word = bit ? c->code_word - low_shift : c->code_word;
>
> Does the compiler "get" that
> bit == !((c->high - low) >> 31)
> not sure that actually is any faster to calculate, but what the
> compiler did looked rather bad to me...

Feel free to improve it.

Dark Shikari
Måns Rullgård | 1 Jul 02:06 2010

Re: r23921 - trunk/libavcodec/vp56.h

Reimar Döffinger <Reimar.Doeffinger <at> gmx.de> writes:

> On Thu, Jul 01, 2010 at 01:18:47AM +0200, darkshikari wrote:
>> Author: darkshikari
>> Date: Thu Jul  1 01:18:47 2010
>> New Revision: 23921
>> 
>> Log:
>> CMOV-ify vp56 arithcoder
>> This incantation causes gcc 4.3 to generate cmov on x86, a vastly better option
>> than a completely unpredictable branch.
>> Hopefully this carries over to newer versions and other CPUs with conditionals.
>> ~5 cycles saved per call on a Core i7.
>
> Nice, I actually tried to make a branchless variant using a mask etc, unfortunately
> it needs so many additional instructions that it ended up being the same speed.
>
>> +    c->high = bit ? c->high - low : low;
>> +    c->code_word = bit ? c->code_word - low_shift : c->code_word;
>
> Does the compiler "get" that
> bit == !((c->high - low) >> 31)
> not sure that actually is any faster to calculate, but what the
> compiler did looked rather bad to me...

((c->high - low) >> 31) + 1 might be friendlier to the compiler than
the ! operator.

--

-- 
Måns Rullgård
(Continue reading)

michael | 1 Jul 02:09 2010
Picon

r23925 - trunk/libavformat/avidec.c

Author: michael
Date: Thu Jul  1 02:09:08 2010
New Revision: 23925

Log:
Prevent infinite recursion of odml indexes.
This fixes a stack overflow.

Modified:
   trunk/libavformat/avidec.c

Modified: trunk/libavformat/avidec.c
==============================================================================
--- trunk/libavformat/avidec.c	Thu Jul  1 01:59:27 2010	(r23924)
+++ trunk/libavformat/avidec.c	Thu Jul  1 02:09:08 2010	(r23925)
 <at>  <at>  -61,6 +61,8  <at>  <at>  typedef struct {
     int non_interleaved;
     int stream_index;
     DVDemuxContext* dv_demux;
+    int odml_depth;
+#define MAX_ODML_DEPTH 1000
 } AVIContext;

 static const char avi_headers[][8] = {
 <at>  <at>  -190,8 +192,15  <at>  <at>  static int read_braindead_odml_indx(AVFo

             pos = url_ftell(pb);

+            if(avi->odml_depth > MAX_ODML_DEPTH){
+                av_log(s, AV_LOG_ERROR, "Too deeply nested ODML indexes\n");
(Continue reading)


Gmane