Browse code

Merge remote-tracking branch 'qatar/master'

* qatar/master:
configure: add POWER[5-7] support
arm: intreadwrite: revert 16-bit load asm to old version for gcc < 4.6
vqavideo: return error if image size is not a multiple of block size
cosmetics: indentation
avformat: only fill-in interpolated timestamps if duration is non-zero
avformat: remove a workaround for broken timestamps

Conflicts:
libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/05/05 07:44:48
Showing 4 changed files
... ...
@@ -2481,9 +2481,12 @@ elif enabled ppc; then
2481 2481
         74*|ppc74*|powerpc74*)
2482 2482
             cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
2483 2483
         ;;
2484
-        g5|970|ppc970|powerpc970|power4*)
2484
+        g5|970|ppc970|powerpc970)
2485 2485
             cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
2486 2486
         ;;
2487
+        power[3-7]*)
2488
+            cpuflags="-mcpu=$cpu -mpowerpc-gfxopt -mpowerpc64"
2489
+        ;;
2487 2490
         cell)
2488 2491
             cpuflags="-mcpu=cell"
2489 2492
             enable ldbrx
... ...
@@ -155,6 +155,11 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
155 155
         return -1;
156 156
     }
157 157
 
158
+    if (s->width % s->vector_width || s->height % s->vector_height) {
159
+        av_log(avctx, AV_LOG_ERROR, "Image size not multiple of block size\n");
160
+        return AVERROR_INVALIDDATA;
161
+    }
162
+
158 163
     /* allocate codebooks */
159 164
     s->codebook_size = MAX_CODEBOOK_SIZE;
160 165
     s->codebook = av_malloc(s->codebook_size);
... ...
@@ -164,11 +169,6 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
164 164
     if (!s->next_codebook_buffer)
165 165
         goto fail;
166 166
 
167
-    if (s->width % s->vector_width || s->height % s->vector_height) {
168
-        av_log(avctx, AV_LOG_ERROR, "Picture dimensions are not a multiple of the vector size\n");
169
-        goto fail;
170
-    }
171
-
172 167
     /* allocate decode buffer */
173 168
     s->decode_buffer_size = (s->width / s->vector_width) *
174 169
         (s->height / s->vector_height) * 2;
... ...
@@ -1082,13 +1082,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
1082 1082
             }
1083 1083
 
1084 1084
             /* presentation is not delayed : PTS and DTS are the same */
1085
-            if(pkt->pts == AV_NOPTS_VALUE)
1085
+            if (pkt->pts == AV_NOPTS_VALUE)
1086 1086
                 pkt->pts = pkt->dts;
1087
-            update_initial_timestamps(s, pkt->stream_index, pkt->pts, pkt->pts);
1088
-            if(pkt->pts == AV_NOPTS_VALUE)
1087
+            update_initial_timestamps(s, pkt->stream_index, pkt->pts,
1088
+                                      pkt->pts);
1089
+            if (pkt->pts == AV_NOPTS_VALUE)
1089 1090
                 pkt->pts = st->cur_dts;
1090 1091
             pkt->dts = pkt->pts;
1091
-            if(pkt->pts != AV_NOPTS_VALUE)
1092
+            if (pkt->pts != AV_NOPTS_VALUE)
1092 1093
                 st->cur_dts = pkt->pts + duration;
1093 1094
         }
1094 1095
     }
... ...
@@ -30,7 +30,9 @@ static av_always_inline unsigned AV_RN16(const void *p)
30 30
 {
31 31
     const uint8_t *q = p;
32 32
     unsigned v;
33
-#ifdef __thumb__
33
+#if !AV_GCC_VERSION_AT_LEAST(4,6)
34
+    __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)q));
35
+#elif defined __thumb__
34 36
     __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(q[0]), "m"(q[1]));
35 37
 #else
36 38
     __asm__ ("ldrh %0, %1" : "=r"(v) : "Uq"(q[0]), "m"(q[1]));