[oe-commits] org.oe.dev mythtv 0.21: enable appropriate ARM optimization dependant on cpu and patch in NEON support for video

koen commit oe at amethyst.openembedded.net
Thu Jul 24 18:25:38 UTC 2008


mythtv 0.21: enable appropriate ARM optimization dependant on cpu and patch in NEON support for video

Author: koen at openembedded.org
Branch: org.openembedded.dev
Revision: 3d20f1d1881a3c1a4f1187c194690a52cc623413
ViewMTN: http://monotone.openembedded.org/revision/info/3d20f1d1881a3c1a4f1187c194690a52cc623413
Files:
1
packages/mythtv/files/armv5te
packages/mythtv/files/armv6
packages/mythtv/files/armv7a
packages/mythtv/files/armv5te/configh
packages/mythtv/files/armv5te/configmak
packages/mythtv/files/armv6/configh
packages/mythtv/files/armv6/configmak
packages/mythtv/files/armv7a/configh
packages/mythtv/files/armv7a/configmak
packages/mythtv/files/configh
packages/mythtv/files/configmak
packages/mythtv/mythtv-0.21/ffmpeg-arm-update.diff
packages/mythtv/mythtv_0.21.bb
Diffs:

#
# mt diff -r5427f220922dcebba532ba5a50bb342addd6c8ea -r3d20f1d1881a3c1a4f1187c194690a52cc623413
#
#
#
# add_dir "packages/mythtv/files/armv5te"
# 
# add_dir "packages/mythtv/files/armv6"
# 
# add_dir "packages/mythtv/files/armv7a"
# 
# add_file "packages/mythtv/files/armv5te/configh"
#  content [a1db618df92dcc46ce8cbf9c979abf73197ea954]
# 
# add_file "packages/mythtv/files/armv5te/configmak"
#  content [2d37c9ec408fe8cf1e875293db6f3825bd74b5be]
# 
# add_file "packages/mythtv/files/armv6/configh"
#  content [3eea7cc66d82409b657a8f007332b546e81c53e4]
# 
# add_file "packages/mythtv/files/armv6/configmak"
#  content [91672d0d927bf7c8850ef66ce04730446a989d21]
# 
# add_file "packages/mythtv/files/armv7a/configh"
#  content [c0162436c40dac27f4962f26274bdd1627ae4215]
# 
# add_file "packages/mythtv/files/armv7a/configmak"
#  content [3d7ce3bc7c569cfe64eb8b44bba400381535f3dc]
# 
# add_file "packages/mythtv/files/configh"
#  content [5391daaca1ed71479d23273c605e1c78636d53ad]
# 
# add_file "packages/mythtv/files/configmak"
#  content [da39a3ee5e6b4b0d3255bfef95601890afd80709]
# 
# add_file "packages/mythtv/mythtv-0.21/ffmpeg-arm-update.diff"
#  content [00646ac44c5e0d42262c6fcd48840a23054e7942]
# 
# patch "packages/mythtv/mythtv_0.21.bb"
#  from [68af05c3a2c6d5221148cdae19cf9cc8b89362ec]
#    to [590a51ee6de14a40660a5ab607d88ecb36aaa2ff]
#
============================================================
--- packages/mythtv/files/armv5te/configh	a1db618df92dcc46ce8cbf9c979abf73197ea954
+++ packages/mythtv/files/armv5te/configh	a1db618df92dcc46ce8cbf9c979abf73197ea954
@@ -0,0 +1,6 @@
+#define HAVE_LLRINT 1
+#define HAVE_ROUNDF 1
+#define ARCH_ARMV4L 1
+#define ENABLE_ARMV4L 1
+#define HAVE_ARMV5TE 1
+#define ENABLE_ARMV5TE 1
============================================================
--- packages/mythtv/files/armv5te/configmak	2d37c9ec408fe8cf1e875293db6f3825bd74b5be
+++ packages/mythtv/files/armv5te/configmak	2d37c9ec408fe8cf1e875293db6f3825bd74b5be
@@ -0,0 +1,3 @@
+ARCH_ARMV4L=yes
+HAVE_ARMV5TE=yes
+
============================================================
--- packages/mythtv/files/armv6/configh	3eea7cc66d82409b657a8f007332b546e81c53e4
+++ packages/mythtv/files/armv6/configh	3eea7cc66d82409b657a8f007332b546e81c53e4
@@ -0,0 +1,8 @@
+#define HAVE_LLRINT 1
+#define HAVE_ROUNDF 1
+#define ARCH_ARMV4L 1
+#define ENABLE_ARMV4L 1
+#define HAVE_ARMV5TE 1
+#define ENABLE_ARMV5TE 1
+#define HAVE_ARMV6 1
+#define ENABLE_ARMV6 1
============================================================
--- packages/mythtv/files/armv6/configmak	91672d0d927bf7c8850ef66ce04730446a989d21
+++ packages/mythtv/files/armv6/configmak	91672d0d927bf7c8850ef66ce04730446a989d21
@@ -0,0 +1,3 @@
+ARCH_ARMV4L=yes
+HAVE_ARMV5TE=yes
+HAVE_ARMV6=yes
============================================================
--- packages/mythtv/files/armv7a/configh	c0162436c40dac27f4962f26274bdd1627ae4215
+++ packages/mythtv/files/armv7a/configh	c0162436c40dac27f4962f26274bdd1627ae4215
@@ -0,0 +1,14 @@
+#define HAVE_LLRINT 1
+#define HAVE_ROUNDF 1
+#define ARCH_ARMV4L 1
+#define ENABLE_ARMV4L 1
+#define HAVE_ARMV5TE 1
+#define ENABLE_ARMV5TE 1
+#define HAVE_ARMV6 1
+#define ENABLE_ARMV6 1
+#define HAVE_ARMV6T2 1
+#define ENABLE_ARMV6T2 1
+#define HAVE_ARMVFP 1
+#define ENABLE_ARMVFP 1
+#define HAVE_NEON 1
+#define ENABLE_NEON 1
============================================================
--- packages/mythtv/files/armv7a/configmak	3d7ce3bc7c569cfe64eb8b44bba400381535f3dc
+++ packages/mythtv/files/armv7a/configmak	3d7ce3bc7c569cfe64eb8b44bba400381535f3dc
@@ -0,0 +1,6 @@
+ARCH_ARMV4L=yes
+HAVE_ARMV5TE=yes
+HAVE_ARMV6=yes
+HAVE_ARMV6T2=yes
+HAVE_ARMVFP=yes
+HAVE_NEON=yes
============================================================
--- packages/mythtv/files/configh	5391daaca1ed71479d23273c605e1c78636d53ad
+++ packages/mythtv/files/configh	5391daaca1ed71479d23273c605e1c78636d53ad
@@ -0,0 +1,2 @@
+#define HAVE_LLRINT 1
+#define HAVE_ROUNDF 1
============================================================
--- packages/mythtv/files/configmak	da39a3ee5e6b4b0d3255bfef95601890afd80709
+++ packages/mythtv/files/configmak	da39a3ee5e6b4b0d3255bfef95601890afd80709
============================================================
--- packages/mythtv/mythtv-0.21/ffmpeg-arm-update.diff	00646ac44c5e0d42262c6fcd48840a23054e7942
+++ packages/mythtv/mythtv-0.21/ffmpeg-arm-update.diff	00646ac44c5e0d42262c6fcd48840a23054e7942
@@ -0,0 +1,1669 @@
+diff -Nurd mythtv.orig/libs/libavcodec/armv4l/dsputil_arm.c mythtv/libs/libavcodec/armv4l/dsputil_arm.c
+--- mythtv.orig/libs/libavcodec/armv4l/dsputil_arm.c	2008-07-23 12:19:05.000000000 +0200
++++ mythtv/libs/libavcodec/armv4l/dsputil_arm.c	2008-07-24 19:54:00.753198000 +0200
+@@ -19,12 +19,14 @@
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ 
+-#include "dsputil.h"
++#include "libavcodec/dsputil.h"
+ #ifdef HAVE_IPP
+-#include "ipp.h"
++#include <ipp.h>
+ #endif
+ 
+ extern void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx);
++extern void ff_float_init_arm_vfp(DSPContext* c, AVCodecContext *avctx);
++extern void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx);
+ 
+ extern void j_rev_dct_ARM(DCTELEM *data);
+ extern void simple_idct_ARM(DCTELEM *data);
+@@ -41,6 +43,12 @@
+ extern void ff_simple_idct_add_armv6(uint8_t *dest, int line_size,
+                                      DCTELEM *data);
+ 
++extern void ff_simple_idct_neon(DCTELEM *data);
++extern void ff_simple_idct_put_neon(uint8_t *dest, int line_size,
++                                    DCTELEM *data);
++extern void ff_simple_idct_add_neon(uint8_t *dest, int line_size,
++                                    DCTELEM *data);
++
+ /* XXX: local hack */
+ static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
+ static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
+@@ -202,6 +210,24 @@
+ }
+ #endif
+ 
++#ifdef HAVE_ARMV5TE
++static void prefetch_arm(void *mem, int stride, int h)
++{
++    asm volatile(
++        "1:              \n\t"
++        "subs %0, %0, #1 \n\t"
++        "pld  [%1]       \n\t"
++        "add  %1, %1, %2 \n\t"
++        "bgt  1b         \n\t"
++        : "+r"(h), "+r"(mem) : "r"(stride));
++}
++#endif
++
++int mm_support(void)
++{
++    return ENABLE_IWMMXT * MM_IWMMXT;
++}
++
+ void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx)
+ {
+     int idct_algo= avctx->idct_algo;
+@@ -209,49 +235,60 @@
+     ff_put_pixels_clamped = c->put_pixels_clamped;
+     ff_add_pixels_clamped = c->add_pixels_clamped;
+ 
+-    if(idct_algo == FF_IDCT_AUTO){
++    if (avctx->lowres == 0) {
++        if(idct_algo == FF_IDCT_AUTO){
+ #if defined(HAVE_IPP)
+-        idct_algo = FF_IDCT_IPP;
++            idct_algo = FF_IDCT_IPP;
++#elif defined(HAVE_NEON)
++            idct_algo = FF_IDCT_SIMPLENEON;
+ #elif defined(HAVE_ARMV6)
+-        idct_algo = FF_IDCT_SIMPLEARMV6;
++            idct_algo = FF_IDCT_SIMPLEARMV6;
+ #elif defined(HAVE_ARMV5TE)
+-        idct_algo = FF_IDCT_SIMPLEARMV5TE;
++            idct_algo = FF_IDCT_SIMPLEARMV5TE;
+ #else
+-        idct_algo = FF_IDCT_ARM;
++            idct_algo = FF_IDCT_ARM;
+ #endif
+-    }
++        }
+ 
+-    if(idct_algo==FF_IDCT_ARM){
+-        c->idct_put= j_rev_dct_ARM_put;
+-        c->idct_add= j_rev_dct_ARM_add;
+-        c->idct    = j_rev_dct_ARM;
+-        c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */
+-    } else if (idct_algo==FF_IDCT_SIMPLEARM){
+-        c->idct_put= simple_idct_ARM_put;
+-        c->idct_add= simple_idct_ARM_add;
+-        c->idct    = simple_idct_ARM;
+-        c->idct_permutation_type= FF_NO_IDCT_PERM;
++        if(idct_algo==FF_IDCT_ARM){
++            c->idct_put= j_rev_dct_ARM_put;
++            c->idct_add= j_rev_dct_ARM_add;
++            c->idct    = j_rev_dct_ARM;
++            c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */
++        } else if (idct_algo==FF_IDCT_SIMPLEARM){
++            c->idct_put= simple_idct_ARM_put;
++            c->idct_add= simple_idct_ARM_add;
++            c->idct    = simple_idct_ARM;
++            c->idct_permutation_type= FF_NO_IDCT_PERM;
+ #ifdef HAVE_ARMV6
+-    } else if (idct_algo==FF_IDCT_SIMPLEARMV6){
+-        c->idct_put= ff_simple_idct_put_armv6;
+-        c->idct_add= ff_simple_idct_add_armv6;
+-        c->idct    = ff_simple_idct_armv6;
+-        c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
++        } else if (idct_algo==FF_IDCT_SIMPLEARMV6){
++            c->idct_put= ff_simple_idct_put_armv6;
++            c->idct_add= ff_simple_idct_add_armv6;
++            c->idct    = ff_simple_idct_armv6;
++            c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
+ #endif
+ #ifdef HAVE_ARMV5TE
+-    } else if (idct_algo==FF_IDCT_SIMPLEARMV5TE){
+-        c->idct_put= simple_idct_put_armv5te;
+-        c->idct_add= simple_idct_add_armv5te;
+-        c->idct    = simple_idct_armv5te;
+-        c->idct_permutation_type = FF_NO_IDCT_PERM;
++        } else if (idct_algo==FF_IDCT_SIMPLEARMV5TE){
++            c->idct_put= simple_idct_put_armv5te;
++            c->idct_add= simple_idct_add_armv5te;
++            c->idct    = simple_idct_armv5te;
++            c->idct_permutation_type = FF_NO_IDCT_PERM;
+ #endif
+ #ifdef HAVE_IPP
+-    } else if (idct_algo==FF_IDCT_IPP){
+-        c->idct_put= simple_idct_ipp_put;
+-        c->idct_add= simple_idct_ipp_add;
+-        c->idct    = simple_idct_ipp;
+-        c->idct_permutation_type= FF_NO_IDCT_PERM;
++        } else if (idct_algo==FF_IDCT_IPP){
++            c->idct_put= simple_idct_ipp_put;
++            c->idct_add= simple_idct_ipp_add;
++            c->idct    = simple_idct_ipp;
++            c->idct_permutation_type= FF_NO_IDCT_PERM;
++#endif
++#ifdef HAVE_NEON
++        } else if (idct_algo==FF_IDCT_SIMPLENEON){
++            c->idct_put= ff_simple_idct_put_neon;
++            c->idct_add= ff_simple_idct_add_neon;
++            c->idct    = ff_simple_idct_neon;
++            c->idct_permutation_type = FF_NO_IDCT_PERM;
+ #endif
++        }
+     }
+ 
+     c->put_pixels_tab[0][0] = put_pixels16_arm;
+@@ -271,7 +308,17 @@
+     c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_arm; //OK
+     c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm;
+ 
++#ifdef HAVE_ARMV5TE
++    c->prefetch = prefetch_arm;
++#endif
++
+ #ifdef HAVE_IWMMXT
+     dsputil_init_iwmmxt(c, avctx);
+ #endif
++#ifdef HAVE_ARMVFP
++    ff_float_init_arm_vfp(c, avctx);
++#endif
++#ifdef HAVE_NEON
++    ff_dsputil_init_neon(c, avctx);
++#endif
+ }
+diff -Nurd mythtv.orig/libs/libavcodec/armv4l/dsputil_arm_s.S mythtv/libs/libavcodec/armv4l/dsputil_arm_s.S
+--- mythtv.orig/libs/libavcodec/armv4l/dsputil_arm_s.S	2008-07-23 12:19:05.000000000 +0200
++++ mythtv/libs/libavcodec/armv4l/dsputil_arm_s.S	2008-07-24 19:54:00.753198000 +0200
+@@ -19,6 +19,13 @@
+ @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ @
+ 
++#include "config.h"
++
++#ifndef HAVE_PLD
++.macro pld reg
++.endm
++#endif
++
+ .macro  ADJ_ALIGN_QUADWORD_D shift, Rd0, Rd1, Rd2, Rd3, Rn0, Rn1, Rn2, Rn3, Rn4
+         mov \Rd0, \Rn0, lsr #(\shift * 8)
+         mov \Rd1, \Rn1, lsr #(\shift * 8)
+diff -Nurd mythtv.orig/libs/libavcodec/armv4l/dsputil_iwmmxt.c mythtv/libs/libavcodec/armv4l/dsputil_iwmmxt.c
+--- mythtv.orig/libs/libavcodec/armv4l/dsputil_iwmmxt.c	2008-07-23 12:19:05.000000000 +0200
++++ mythtv/libs/libavcodec/armv4l/dsputil_iwmmxt.c	2008-07-24 19:54:00.753198000 +0200
+@@ -19,10 +19,10 @@
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ 
+-#include "dsputil.h"
++#include "libavcodec/dsputil.h"
+ 
+ #define DEF(x, y) x ## _no_rnd_ ## y ##_iwmmxt
+-#define SET_RND(regd)  __asm__ __volatile__ ("mov r12, #1 \n\t tbcsth " #regd ", r12":::"r12");
++#define SET_RND(regd)  asm volatile ("mov r12, #1 \n\t tbcsth " #regd ", r12":::"r12");
+ #define WAVG2B "wavg2b"
+ #include "dsputil_iwmmxt_rnd.h"
+ #undef DEF
+@@ -30,7 +30,7 @@
+ #undef WAVG2B
+ 
+ #define DEF(x, y) x ## _ ## y ##_iwmmxt
+-#define SET_RND(regd)  __asm__ __volatile__ ("mov r12, #2 \n\t tbcsth " #regd ", r12":::"r12");
++#define SET_RND(regd)  asm volatile ("mov r12, #2 \n\t tbcsth " #regd ", r12":::"r12");
+ #define WAVG2B "wavg2br"
+ #include "dsputil_iwmmxt_rnd.h"
+ #undef DEF
+@@ -89,7 +89,7 @@
+ {
+     uint8_t *pixels2 = pixels + line_size;
+ 
+-    __asm__ __volatile__ (
++    asm volatile (
+         "mov            r12, #4                 \n\t"
+         "1:                                     \n\t"
+         "pld            [%[pixels], %[line_size2]]              \n\t"
+@@ -125,7 +125,7 @@
+ 
+ static void clear_blocks_iwmmxt(DCTELEM *blocks)
+ {
+-    __asm __volatile(
++    asm volatile(
+                 "wzero wr0                      \n\t"
+                 "mov r1, #(128 * 6 / 32)        \n\t"
+                 "1:                             \n\t"
+diff -Nurd mythtv.orig/libs/libavcodec/armv4l/dsputil_iwmmxt_rnd.h mythtv/libs/libavcodec/armv4l/dsputil_iwmmxt_rnd.h
+--- mythtv.orig/libs/libavcodec/armv4l/dsputil_iwmmxt_rnd.h	2008-07-23 12:19:05.000000000 +0200
++++ mythtv/libs/libavcodec/armv4l/dsputil_iwmmxt_rnd.h	2008-07-24 19:54:01.023198000 +0200
+@@ -19,13 +19,14 @@
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ 
+-#ifndef FFMPEG_DSPUTIL_IWMMXT_RND_H
+-#define FFMPEG_DSPUTIL_IWMMXT_RND_H
++/* This header intentionally has no multiple inclusion guards. It is meant to
++ * be included multiple times and generates different code depending on the
++ * value of certain #defines. */
+ 
+ void DEF(put, pixels8)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
+ {
+     int stride = line_size;
+-    __asm__ __volatile__ (
++    asm volatile (
+         "and r12, %[pixels], #7 \n\t"
+         "bic %[pixels], %[pixels], #7 \n\t"
+         "tmcr wcgr1, r12 \n\t"
+@@ -59,7 +60,7 @@
+ void DEF(avg, pixels8)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
+ {
+     int stride = line_size;
+-    __asm__ __volatile__ (
++    asm volatile (
+         "and r12, %[pixels], #7 \n\t"
+         "bic %[pixels], %[pixels], #7 \n\t"
+         "tmcr wcgr1, r12 \n\t"
+@@ -101,7 +102,7 @@
+ void DEF(put, pixels16)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
+ {
+     int stride = line_size;
+-    __asm__ __volatile__ (
++    asm volatile (
+         "and r12, %[pixels], #7 \n\t"
+         "bic %[pixels], %[pixels], #7 \n\t"
+         "tmcr wcgr1, r12 \n\t"
+@@ -141,7 +142,7 @@
+ void DEF(avg, pixels16)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
+ {
+     int stride = line_size;
+-    __asm__ __volatile__ (
++    asm volatile (
+         "pld [%[pixels]]                \n\t"
+         "pld [%[pixels], #32]           \n\t"
+         "pld [%[block]]                 \n\t"
+@@ -200,7 +201,7 @@
+     // [wr0 wr1 wr2 wr3] for previous line
+     // [wr4 wr5 wr6 wr7] for current line
+     SET_RND(wr15); // =2 for rnd  and  =1 for no_rnd version
+-    __asm__ __volatile__(
++    asm volatile(
+         "pld [%[pixels]]                \n\t"
+         "pld [%[pixels], #32]           \n\t"
+         "and r12, %[pixels], #7         \n\t"
+@@ -249,7 +250,7 @@
+     // [wr0 wr1 wr2 wr3] for previous line
+     // [wr4 wr5 wr6 wr7] for current line
+     SET_RND(wr15); // =2 for rnd  and  =1 for no_rnd version
+-    __asm__ __volatile__(
++    asm volatile(
+         "pld [%[pixels]]                \n\t"
+         "pld [%[pixels], #32]           \n\t"
+         "and r12, %[pixels], #7         \n\t"
+@@ -310,7 +311,7 @@
+     // [wr0 wr1 wr2 wr3] for previous line
+     // [wr4 wr5 wr6 wr7] for current line
+     SET_RND(wr15); // =2 for rnd  and  =1 for no_rnd version
+-    __asm__ __volatile__(
++    asm volatile(
+         "pld [%[pixels]]                \n\t"
+         "pld [%[pixels], #32]           \n\t"
+         "pld [%[block]]                 \n\t"
+@@ -371,7 +372,7 @@
+     // [wr0 wr1 wr2 wr3] for previous line
+     // [wr4 wr5 wr6 wr7] for current line
+     SET_RND(wr15); // =2 for rnd  and  =1 for no_rnd version
+-    __asm__ __volatile__(
++    asm volatile(
+         "pld [%[pixels]]                \n\t"
+         "pld [%[pixels], #32]           \n\t"
+         "pld [%[block]]                 \n\t"
+@@ -447,7 +448,7 @@
+     int stride = line_size;
+     // [wr0 wr1 wr2 wr3] for previous line
+     // [wr4 w%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list