* commit '68f18f03519ae550e25cf12661172641e9f0eaca':
videodsp_armv5te: remove #if HAVE_ARMV5TE_EXTERNAL
dsputil: drop non-compliant "fast" qpel mc functions
get_bits: change the failure condition in init_get_bits
Conflicts:
libavcodec/get_bits.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -22,7 +22,6 @@ |
22 | 22 |
#include "config.h" |
23 | 23 |
#include "libavutil/arm/asm.S" |
24 | 24 |
|
25 |
-#if HAVE_ARMV5TE_EXTERNAL |
|
26 | 25 |
function ff_prefetch_arm, export=1 |
27 | 26 |
subs r2, r2, #1 |
28 | 27 |
pld [r0] |
... | ... |
@@ -30,4 +29,3 @@ function ff_prefetch_arm, export=1 |
30 | 30 |
bne ff_prefetch_arm |
31 | 31 |
bx lr |
32 | 32 |
endfunc |
33 |
-#endif |
... | ... |
@@ -2790,8 +2790,6 @@ int ff_check_alignment(void){ |
2790 | 2790 |
|
2791 | 2791 |
av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) |
2792 | 2792 |
{ |
2793 |
- int i, j; |
|
2794 |
- |
|
2795 | 2793 |
ff_check_alignment(); |
2796 | 2794 |
|
2797 | 2795 |
#if CONFIG_ENCODERS |
... | ... |
@@ -3013,9 +3011,6 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) |
3013 | 3013 |
c->shrink[2]= ff_shrink44; |
3014 | 3014 |
c->shrink[3]= ff_shrink88; |
3015 | 3015 |
|
3016 |
- memset(c->put_2tap_qpel_pixels_tab, 0, sizeof(c->put_2tap_qpel_pixels_tab)); |
|
3017 |
- memset(c->avg_2tap_qpel_pixels_tab, 0, sizeof(c->avg_2tap_qpel_pixels_tab)); |
|
3018 |
- |
|
3019 | 3016 |
#undef FUNC |
3020 | 3017 |
#undef FUNCC |
3021 | 3018 |
#define FUNC(f, depth) f ## _ ## depth |
... | ... |
@@ -3128,17 +3123,6 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) |
3128 | 3128 |
if (ARCH_SH4) ff_dsputil_init_sh4 (c, avctx); |
3129 | 3129 |
if (ARCH_BFIN) ff_dsputil_init_bfin (c, avctx); |
3130 | 3130 |
|
3131 |
- for (i = 0; i < 4; i++) { |
|
3132 |
- for (j = 0; j < 16; j++) { |
|
3133 |
- if(!c->put_2tap_qpel_pixels_tab[i][j]) |
|
3134 |
- c->put_2tap_qpel_pixels_tab[i][j] = |
|
3135 |
- c->put_h264_qpel_pixels_tab[i][j]; |
|
3136 |
- if(!c->avg_2tap_qpel_pixels_tab[i][j]) |
|
3137 |
- c->avg_2tap_qpel_pixels_tab[i][j] = |
|
3138 |
- c->avg_h264_qpel_pixels_tab[i][j]; |
|
3139 |
- } |
|
3140 |
- } |
|
3141 |
- |
|
3142 | 3131 |
ff_init_scantable_permutation(c->idct_permutation, |
3143 | 3132 |
c->idct_permutation_type); |
3144 | 3133 |
} |
... | ... |
@@ -339,9 +339,6 @@ typedef struct DSPContext { |
339 | 339 |
qpel_mc_func put_h264_qpel_pixels_tab[4][16]; |
340 | 340 |
qpel_mc_func avg_h264_qpel_pixels_tab[4][16]; |
341 | 341 |
|
342 |
- qpel_mc_func put_2tap_qpel_pixels_tab[4][16]; |
|
343 |
- qpel_mc_func avg_2tap_qpel_pixels_tab[4][16]; |
|
344 |
- |
|
345 | 342 |
me_cmp_func pix_abs[2][4]; |
346 | 343 |
|
347 | 344 |
/* huffyuv specific */ |
... | ... |
@@ -379,7 +379,7 @@ static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, |
379 | 379 |
int buffer_size; |
380 | 380 |
int ret = 0; |
381 | 381 |
|
382 |
- if (bit_size >= INT_MAX - 7 || bit_size < 0) { |
|
382 |
+ if (bit_size >= INT_MAX - 7 || bit_size < 0 || !buffer) { |
|
383 | 383 |
buffer_size = bit_size = 0; |
384 | 384 |
buffer = NULL; |
385 | 385 |
ret = AVERROR_INVALIDDATA; |
... | ... |
@@ -643,10 +643,7 @@ retry: |
643 | 643 |
s->next_p_frame_damaged=0; |
644 | 644 |
} |
645 | 645 |
|
646 |
- if((s->avctx->flags2 & CODEC_FLAG2_FAST) && s->pict_type==AV_PICTURE_TYPE_B){ |
|
647 |
- s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab; |
|
648 |
- s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab; |
|
649 |
- }else if((!s->no_rounding) || s->pict_type==AV_PICTURE_TYPE_B){ |
|
646 |
+ if((!s->no_rounding) || s->pict_type==AV_PICTURE_TYPE_B){ |
|
650 | 647 |
s->me.qpel_put= s->dsp.put_qpel_pixels_tab; |
651 | 648 |
s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab; |
652 | 649 |
}else{ |
... | ... |
@@ -2666,15 +2666,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0) |
2666 | 2666 |
int must_reinit; |
2667 | 2667 |
int needs_reinit = 0; |
2668 | 2668 |
|
2669 |
- /* FIXME: 2tap qpel isn't implemented for high bit depth. */ |
|
2670 |
- if ((s->avctx->flags2 & CODEC_FLAG2_FAST) && |
|
2671 |
- !h->nal_ref_idc && !h->pixel_shift) { |
|
2672 |
- s->me.qpel_put = s->dsp.put_2tap_qpel_pixels_tab; |
|
2673 |
- s->me.qpel_avg = s->dsp.avg_2tap_qpel_pixels_tab; |
|
2674 |
- } else { |
|
2675 |
- s->me.qpel_put = s->dsp.put_h264_qpel_pixels_tab; |
|
2676 |
- s->me.qpel_avg = s->dsp.avg_h264_qpel_pixels_tab; |
|
2677 |
- } |
|
2669 |
+ s->me.qpel_put = s->dsp.put_h264_qpel_pixels_tab; |
|
2670 |
+ s->me.qpel_avg = s->dsp.avg_h264_qpel_pixels_tab; |
|
2678 | 2671 |
|
2679 | 2672 |
first_mb_in_slice = get_ue_golomb_long(&s->gb); |
2680 | 2673 |
|
... | ... |
@@ -802,54 +802,3 @@ static void DEF(avg_pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int lin |
802 | 802 |
DEF(avg_pixels8_xy2)(block , pixels , line_size, h); |
803 | 803 |
DEF(avg_pixels8_xy2)(block+8, pixels+8, line_size, h); |
804 | 804 |
} |
805 |
- |
|
806 |
-#define QPEL_2TAP_L3(OPNAME) \ |
|
807 |
-static void DEF(OPNAME ## 2tap_qpel16_l3)(uint8_t *dst, uint8_t *src, int stride, int h, int off1, int off2){\ |
|
808 |
- __asm__ volatile(\ |
|
809 |
- "1: \n\t"\ |
|
810 |
- "movq (%1,%2), %%mm0 \n\t"\ |
|
811 |
- "movq 8(%1,%2), %%mm1 \n\t"\ |
|
812 |
- PAVGB" (%1,%3), %%mm0 \n\t"\ |
|
813 |
- PAVGB" 8(%1,%3), %%mm1 \n\t"\ |
|
814 |
- PAVGB" (%1), %%mm0 \n\t"\ |
|
815 |
- PAVGB" 8(%1), %%mm1 \n\t"\ |
|
816 |
- STORE_OP( (%1,%4),%%mm0)\ |
|
817 |
- STORE_OP(8(%1,%4),%%mm1)\ |
|
818 |
- "movq %%mm0, (%1,%4) \n\t"\ |
|
819 |
- "movq %%mm1, 8(%1,%4) \n\t"\ |
|
820 |
- "add %5, %1 \n\t"\ |
|
821 |
- "decl %0 \n\t"\ |
|
822 |
- "jnz 1b \n\t"\ |
|
823 |
- :"+g"(h), "+r"(src)\ |
|
824 |
- :"r"((x86_reg)off1), "r"((x86_reg)off2),\ |
|
825 |
- "r"((x86_reg)(dst-src)), "r"((x86_reg)stride)\ |
|
826 |
- :"memory"\ |
|
827 |
- );\ |
|
828 |
-}\ |
|
829 |
-static void DEF(OPNAME ## 2tap_qpel8_l3)(uint8_t *dst, uint8_t *src, int stride, int h, int off1, int off2){\ |
|
830 |
- __asm__ volatile(\ |
|
831 |
- "1: \n\t"\ |
|
832 |
- "movq (%1,%2), %%mm0 \n\t"\ |
|
833 |
- PAVGB" (%1,%3), %%mm0 \n\t"\ |
|
834 |
- PAVGB" (%1), %%mm0 \n\t"\ |
|
835 |
- STORE_OP((%1,%4),%%mm0)\ |
|
836 |
- "movq %%mm0, (%1,%4) \n\t"\ |
|
837 |
- "add %5, %1 \n\t"\ |
|
838 |
- "decl %0 \n\t"\ |
|
839 |
- "jnz 1b \n\t"\ |
|
840 |
- :"+g"(h), "+r"(src)\ |
|
841 |
- :"r"((x86_reg)off1), "r"((x86_reg)off2),\ |
|
842 |
- "r"((x86_reg)(dst-src)), "r"((x86_reg)stride)\ |
|
843 |
- :"memory"\ |
|
844 |
- );\ |
|
845 |
-} |
|
846 |
- |
|
847 |
-#ifndef SKIP_FOR_3DNOW |
|
848 |
-#define STORE_OP(a,b) PAVGB" "#a","#b" \n\t" |
|
849 |
-QPEL_2TAP_L3(avg_) |
|
850 |
-#undef STORE_OP |
|
851 |
-#define STORE_OP(a,b) |
|
852 |
-QPEL_2TAP_L3(put_) |
|
853 |
-#undef STORE_OP |
|
854 |
-#undef QPEL_2TAP_L3 |
|
855 |
-#endif /* SKIP_FOR_3DNOW */ |
... | ... |
@@ -1577,63 +1577,6 @@ QPEL_OP(put_, ff_pw_16, _, PUT_OP, mmxext) |
1577 | 1577 |
QPEL_OP(avg_, ff_pw_16, _, AVG_MMXEXT_OP, mmxext) |
1578 | 1578 |
QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, mmxext) |
1579 | 1579 |
|
1580 |
-/***********************************/ |
|
1581 |
-/* bilinear qpel: not compliant to any spec, only for -lavdopts fast */ |
|
1582 |
- |
|
1583 |
-#define QPEL_2TAP_XY(OPNAME, SIZE, MMX, XY, HPEL) \ |
|
1584 |
-static void OPNAME ## 2tap_qpel ## SIZE ## _mc ## XY ## _ ## MMX(uint8_t *dst, \ |
|
1585 |
- uint8_t *src, \ |
|
1586 |
- int stride) \ |
|
1587 |
-{ \ |
|
1588 |
- OPNAME ## pixels ## SIZE ## HPEL(dst, src, stride, SIZE); \ |
|
1589 |
-} |
|
1590 |
- |
|
1591 |
-#define QPEL_2TAP_L3(OPNAME, SIZE, MMX, XY, S0, S1, S2) \ |
|
1592 |
-static void OPNAME ## 2tap_qpel ## SIZE ## _mc ## XY ## _ ## MMX(uint8_t *dst, \ |
|
1593 |
- uint8_t *src, \ |
|
1594 |
- int stride) \ |
|
1595 |
-{ \ |
|
1596 |
- OPNAME ## 2tap_qpel ## SIZE ## _l3_ ## MMX(dst, src + S0, stride, SIZE, \ |
|
1597 |
- S1, S2); \ |
|
1598 |
-} |
|
1599 |
- |
|
1600 |
-#define QPEL_2TAP(OPNAME, SIZE, MMX) \ |
|
1601 |
-QPEL_2TAP_XY(OPNAME, SIZE, MMX, 20, _x2_ ## MMX) \ |
|
1602 |
-QPEL_2TAP_XY(OPNAME, SIZE, MMX, 02, _y2_ ## MMX) \ |
|
1603 |
-QPEL_2TAP_XY(OPNAME, SIZE, MMX, 22, _xy2_mmx) \ |
|
1604 |
-static const qpel_mc_func OPNAME ## 2tap_qpel ## SIZE ## _mc00_ ## MMX = \ |
|
1605 |
- OPNAME ## qpel ## SIZE ## _mc00_ ## MMX; \ |
|
1606 |
-static const qpel_mc_func OPNAME ## 2tap_qpel ## SIZE ## _mc21_ ## MMX = \ |
|
1607 |
- OPNAME ## 2tap_qpel ## SIZE ## _mc20_ ## MMX; \ |
|
1608 |
-static const qpel_mc_func OPNAME ## 2tap_qpel ## SIZE ## _mc12_ ## MMX = \ |
|
1609 |
- OPNAME ## 2tap_qpel ## SIZE ## _mc02_ ## MMX; \ |
|
1610 |
-static void OPNAME ## 2tap_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, \ |
|
1611 |
- uint8_t *src, \ |
|
1612 |
- int stride) \ |
|
1613 |
-{ \ |
|
1614 |
- OPNAME ## pixels ## SIZE ## _y2_ ## MMX(dst, src + 1, stride, SIZE); \ |
|
1615 |
-} \ |
|
1616 |
-static void OPNAME ## 2tap_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, \ |
|
1617 |
- uint8_t *src, \ |
|
1618 |
- int stride) \ |
|
1619 |
-{ \ |
|
1620 |
- OPNAME ## pixels ## SIZE ## _x2_ ## MMX(dst, src + stride, \ |
|
1621 |
- stride, SIZE); \ |
|
1622 |
-} \ |
|
1623 |
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 10, 0, 1, 0) \ |
|
1624 |
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 30, 1, -1, 0) \ |
|
1625 |
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 01, 0, stride, 0) \ |
|
1626 |
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 03, stride, -stride, 0) \ |
|
1627 |
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 11, 0, stride, 1) \ |
|
1628 |
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 31, 1, stride, -1) \ |
|
1629 |
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 13, stride, -stride, 1) \ |
|
1630 |
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 33, stride + 1, -stride, -1) \ |
|
1631 |
- |
|
1632 |
-QPEL_2TAP(put_, 16, mmxext) |
|
1633 |
-QPEL_2TAP(avg_, 16, mmxext) |
|
1634 |
-QPEL_2TAP(put_, 8, mmxext) |
|
1635 |
-QPEL_2TAP(avg_, 8, mmxext) |
|
1636 |
- |
|
1637 | 1580 |
void ff_put_rv40_qpel8_mc33_mmx(uint8_t *dst, uint8_t *src, int stride) |
1638 | 1581 |
{ |
1639 | 1582 |
put_pixels8_xy2_mmx(dst, src, stride, 8); |
... | ... |
@@ -2205,13 +2148,9 @@ static void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx, |
2205 | 2205 |
#if HAVE_INLINE_ASM |
2206 | 2206 |
SET_QPEL_FUNCS(avg_qpel, 0, 16, mmxext, ); |
2207 | 2207 |
SET_QPEL_FUNCS(avg_qpel, 1, 8, mmxext, ); |
2208 |
- SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, mmxext, ); |
|
2209 |
- SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, mmxext, ); |
|
2210 | 2208 |
|
2211 | 2209 |
SET_QPEL_FUNCS(put_qpel, 0, 16, mmxext, ); |
2212 | 2210 |
SET_QPEL_FUNCS(put_qpel, 1, 8, mmxext, ); |
2213 |
- SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, mmxext, ); |
|
2214 |
- SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, mmxext, ); |
|
2215 | 2211 |
SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmxext, ); |
2216 | 2212 |
SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmxext, ); |
2217 | 2213 |
|