shithub: libvpx

Download patch

ref: 8e464cc4c2d02e5daa68a45830f053c8a236ab6f
parent: bf53e74b7f23cd9e55aaf820d7914b0890a16177
parent: b2d9700f5313770957878fa36f9971c367f479df
author: John Koleszar <jkoleszar@google.com>
date: Tue Jul 19 20:05:09 EDT 2011

Merge remote branch 'internal/upstream' into HEAD

diff: cannot open a/vp8/decoder/arm/armv5//null: file does not exist: 'a/vp8/decoder/arm/armv5//null'
--- a/vp8/common/entropy.c
+++ b/vp8/common/entropy.c
@@ -26,8 +26,32 @@
 
 #include "coefupdateprobs.h"
 
-DECLARE_ALIGNED(16, cuchar, vp8_coef_bands[16]) = { 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7};
-DECLARE_ALIGNED(16, cuchar, vp8_prev_token_class[MAX_ENTROPY_TOKENS]) = { 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0};
+DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) =
+{
+    0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
+    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+DECLARE_ALIGNED(16, cuchar, vp8_coef_bands[16]) =
+{ 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7};
+
+DECLARE_ALIGNED(16, cuchar, vp8_prev_token_class[MAX_ENTROPY_TOKENS]) =
+{ 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0};
+
 DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]) =
 {
     0,  1,  4,  8,
--- a/vp8/decoder/arm/armv5/dequantize_v5.asm
+++ /dev/null
@@ -1,52 +1,0 @@
-;
-;  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-;  Use of this source code is governed by a BSD-style license
-;  that can be found in the LICENSE file in the root of the source
-;  tree. An additional intellectual property rights grant can be found
-;  in the file PATENTS.  All contributing project authors may
-;  be found in the AUTHORS file in the root of the source tree.
-;
-
-
-    EXPORT  |vp8_dequantize_b_armv5|
-
-    AREA    |.text|, CODE, READONLY  ; name this block of code
-
-q       RN  r0
-dqc     RN  r1
-cnt     RN  r2
-
-;void dequantize_b_armv5(short *Q, short *DQC)
-|vp8_dequantize_b_armv5| PROC
-    stmdb   sp!, {r4, lr}
-    ldr     r3, [q]
-    ldr     r4, [dqc], #8
-
-    mov     cnt, #4
-dequant_loop
-    smulbb  lr, r3, r4
-    smultt  r12, r3, r4
-
-    ldr     r3, [q, #4]
-    ldr     r4, [dqc, #-4]
-
-    strh    lr, [q], #2
-    strh    r12, [q], #2
-
-    smulbb  lr, r3, r4
-    smultt  r12, r3, r4
-
-    subs    cnt, cnt, #1
-    ldrne   r3, [q, #4]
-    ldrne   r4, [dqc], #8
-
-    strh    lr, [q], #2
-    strh    r12, [q], #2
-
-    bne     dequant_loop
-
-    ldmia   sp!, {r4, pc}
-    ENDP    ;|vp8_dequantize_b_arm|
-
-    END
--- a/vp8/decoder/dboolhuff.c
+++ b/vp8/decoder/dboolhuff.c
@@ -13,19 +13,6 @@
 #include "vpx_ports/mem.h"
 #include "vpx_mem/vpx_mem.h"
 
-DECLARE_ALIGNED(16, const unsigned char, vp8dx_bitreader_norm[256]) =
-{
-    0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-
 int vp8dx_start_decode(BOOL_DECODER *br,
                        const unsigned char *source,
                        unsigned int source_sz)
--- a/vp8/decoder/dboolhuff.h
+++ b/vp8/decoder/dboolhuff.h
@@ -34,7 +34,7 @@
     unsigned int         range;
 } BOOL_DECODER;
 
-DECLARE_ALIGNED(16, extern const unsigned char, vp8dx_bitreader_norm[256]);
+DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]);
 
 int vp8dx_start_decode(BOOL_DECODER *br,
                        const unsigned char *source,
@@ -101,7 +101,7 @@
     }
 
     {
-        register unsigned int shift = vp8dx_bitreader_norm[range];
+        register unsigned int shift = vp8_norm[range];
         range <<= shift;
         value <<= shift;
         count -= shift;
--- a/vp8/decoder/detokenize.c
+++ b/vp8/decoder/detokenize.c
@@ -80,7 +80,7 @@
     }
 }
 
-DECLARE_ALIGNED(16, extern const unsigned char, vp8dx_bitreader_norm[256]);
+DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]);
 #define FILL \
     if(count < 0) \
         VP8DX_BOOL_DECODER_FILL(count, value, bufptr, bufend);
@@ -88,7 +88,7 @@
 #define NORMALIZE \
     /*if(range < 0x80)*/                            \
     { \
-        shift = vp8dx_bitreader_norm[range]; \
+        shift = vp8_norm[range]; \
         range <<= shift; \
         value <<= shift; \
         count -= shift; \
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -160,18 +160,6 @@
     );
 }
 
-static const unsigned int norm[256] =
-{
-    0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
 static void pack_tokens_c(vp8_writer *w, const TOKENEXTRA *p, int xcount)
 {
     const TOKENEXTRA *const stop = p + xcount;
@@ -213,7 +201,7 @@
                 range = split;
             }
 
-            shift = norm[range];
+            shift = vp8_norm[range];
             range <<= shift;
             count += shift;
 
@@ -273,7 +261,7 @@
                         range = split;
                     }
 
-                    shift = norm[range];
+                    shift = vp8_norm[range];
                     range <<= shift;
                     count += shift;
 
@@ -429,7 +417,7 @@
                             range = split;
                         }
 
-                        shift = norm[range];
+                        shift = vp8_norm[range];
                         range <<= shift;
                         count += shift;
 
@@ -489,7 +477,7 @@
                                     range = split;
                                 }
 
-                                shift = norm[range];
+                                shift = vp8_norm[range];
                                 range <<= shift;
                                 count += shift;
 
@@ -636,7 +624,7 @@
                     range = split;
                 }
 
-                shift = norm[range];
+                shift = vp8_norm[range];
                 range <<= shift;
                 count += shift;
 
@@ -696,7 +684,7 @@
                             range = split;
                         }
 
-                        shift = norm[range];
+                        shift = vp8_norm[range];
                         range <<= shift;
                         count += shift;
 
--- a/vp8/encoder/boolhuff.c
+++ b/vp8/encoder/boolhuff.c
@@ -10,10 +10,7 @@
 
 
 #include "boolhuff.h"
-#include "vp8/common/blockd.h"
 
-
-
 #if defined(SECTIONBITS_OUTPUT)
 unsigned __int64 Sectionbits[500];
 
@@ -62,81 +59,6 @@
         vp8_encode_bool(br, 0, 128);
 }
 
-DECLARE_ALIGNED(16, static const unsigned int, norm[256]) =
-{
-    0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-void vp8_encode_bool(BOOL_CODER *br, int bit, int probability)
-{
-    unsigned int split;
-    int count = br->count;
-    unsigned int range = br->range;
-    unsigned int lowvalue = br->lowvalue;
-    register unsigned int shift;
-
-#ifdef ENTROPY_STATS
-#if defined(SECTIONBITS_OUTPUT)
-
-    if (bit)
-        Sectionbits[active_section] += vp8_prob_cost[255-probability];
-    else
-        Sectionbits[active_section] += vp8_prob_cost[probability];
-
-#endif
-#endif
-
-    split = 1 + (((range - 1) * probability) >> 8);
-
-    range = split;
-
-    if (bit)
-    {
-        lowvalue += split;
-        range = br->range - split;
-    }
-
-    shift = norm[range];
-
-    range <<= shift;
-    count += shift;
-
-    if (count >= 0)
-    {
-        int offset = shift - count;
-
-        if ((lowvalue << (offset - 1)) & 0x80000000)
-        {
-            int x = br->pos - 1;
-
-            while (x >= 0 && br->buffer[x] == 0xff)
-            {
-                br->buffer[x] = (unsigned char)0;
-                x--;
-            }
-
-            br->buffer[x] += 1;
-        }
-
-        br->buffer[br->pos++] = (lowvalue >> (24 - offset));
-        lowvalue <<= offset;
-        shift = count;
-        lowvalue &= 0xffffff;
-        count -= 8 ;
-    }
-
-    lowvalue <<= shift;
-    br->count = count;
-    br->lowvalue = lowvalue;
-    br->range = range;
-}
 
 void vp8_encode_value(BOOL_CODER *br, int data, int bits)
 {
--- a/vp8/encoder/boolhuff.h
+++ b/vp8/encoder/boolhuff.h
@@ -19,6 +19,7 @@
 #ifndef __INC_BOOLHUFF_H
 #define __INC_BOOLHUFF_H
 
+#include "vpx_ports/mem.h"
 
 typedef struct
 {
@@ -35,9 +36,77 @@
 } BOOL_CODER;
 
 extern void vp8_start_encode(BOOL_CODER *bc, unsigned char *buffer);
-extern void vp8_encode_bool(BOOL_CODER *bc, int x, int context);
+
 extern void vp8_encode_value(BOOL_CODER *br, int data, int bits);
 extern void vp8_stop_encode(BOOL_CODER *bc);
 extern const unsigned int vp8_prob_cost[256];
+
+
+DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]);
+
+
+static void vp8_encode_bool(BOOL_CODER *br, int bit, int probability)
+{
+    unsigned int split;
+    int count = br->count;
+    unsigned int range = br->range;
+    unsigned int lowvalue = br->lowvalue;
+    register unsigned int shift;
+
+#ifdef ENTROPY_STATS
+#if defined(SECTIONBITS_OUTPUT)
+
+    if (bit)
+        Sectionbits[active_section] += vp8_prob_cost[255-probability];
+    else
+        Sectionbits[active_section] += vp8_prob_cost[probability];
+
+#endif
+#endif
+
+    split = 1 + (((range - 1) * probability) >> 8);
+
+    range = split;
+
+    if (bit)
+    {
+        lowvalue += split;
+        range = br->range - split;
+    }
+
+    shift = vp8_norm[range];
+
+    range <<= shift;
+    count += shift;
+
+    if (count >= 0)
+    {
+        int offset = shift - count;
+
+        if ((lowvalue << (offset - 1)) & 0x80000000)
+        {
+            int x = br->pos - 1;
+
+            while (x >= 0 && br->buffer[x] == 0xff)
+            {
+                br->buffer[x] = (unsigned char)0;
+                x--;
+            }
+
+            br->buffer[x] += 1;
+        }
+
+        br->buffer[br->pos++] = (lowvalue >> (24 - offset));
+        lowvalue <<= offset;
+        shift = count;
+        lowvalue &= 0xffffff;
+        count -= 8 ;
+    }
+
+    lowvalue <<= shift;
+    br->count = count;
+    br->lowvalue = lowvalue;
+    br->range = range;
+}
 
 #endif
--- a/vpx/internal/vpx_codec_internal.h
+++ b/vpx/internal/vpx_codec_internal.h
@@ -45,7 +45,6 @@
 #define VPX_CODEC_INTERNAL_H
 #include "../vpx_decoder.h"
 #include "../vpx_encoder.h"
-#include "vpx_config.h"
 #include <stdarg.h>
 
 
@@ -436,23 +435,6 @@
 
 #include <stdio.h>
 #include <setjmp.h>
-
-/* GLIBC started intercepting calls to longjmp in version 2.11, if the
- * FORTIFY_SOURCE flag is defined (it's defined by default on Ubuntu).
- * This can cause problems running under older versions of GLIBC (ie,
- * for binary distributions), so work around it by linking to the
- * underlying longjmp call directly.
- */
-#if defined(__GNUC_PREREQ)
-#if __GNUC_PREREQ (2,11)
-#if ARCH_X86_64
-__asm__(".symver __longjmp_chk,longjmp@GLIBC_2.2.5");
-#else
-__asm__(".symver __longjmp_chk,longjmp@GLIBC_2.0");
-#endif
-#endif
-#endif
-
 struct vpx_internal_error_info
 {
     vpx_codec_err_t  error_code;