annotate libmpcodecs/vd_roqvideo.c @ 11007:48b7d7aa444d

configure altivec patch by Magnus Damm <damm@opensource.se> * CC is not checked for Altivec support (see above). The patch adds checks for FSF-style flags and Darwin-style flags. The check is performed regardless of the gcc version. * Disabling of Altivec. --disable-altivec is broken today if /proc/cpuinfo shows that your cpu supports altivec. The patch takes care of that. * "GCC & CPU optimization abilities" always show that it is optimizing for the cpu configure is running on, it should show the optimization that is enabled for gcc instead. Cosmetic change only, but confusing as it is today IMHO. * Runtime CPU-detection now enables altivec for powerpc. Now with the patch it should be possible to use --enable-altivec, --disable-altivec, --enable-runtime-cpudetection regardless of powerpc cpu type. The configure script handles altivec support in the following order: 1. Altivec is enabled by default if your cpu supports it. 2. --enable-runtime-cpudetection will enable altivec support. 3. If you have forced altivec on/off with --enable-altivec/--disable-altivec, then your selection will override the previous altivec configuration. 4. If altivec is enabled but the compiler doesn't support it, altivec gets turned off.
author attila
date Sat, 04 Oct 2003 23:06:04 +0000
parents a117511790c0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4989
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
1 #include <stdio.h>
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
2 #include <stdlib.h>
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
3
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
4 #include "config.h"
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
5 #include "mp_msg.h"
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
6
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
7 #include "vd_internal.h"
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
8
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
9 static vd_info_t info = {
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
10 "Id RoQ File Video decoder",
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
11 "roqvideo",
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
12 "A'rpi",
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
13 "Mike Melanson",
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
14 "native codec"
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
15 };
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
16
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
17 LIBVD_EXTERN(roqvideo)
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
18
7470
a117511790c0 declarations moved to *.c files
arpi
parents: 7180
diff changeset
19 // in native/roqav.c:
a117511790c0 declarations moved to *.c files
arpi
parents: 7180
diff changeset
20 void *roq_decode_video_init(void);
a117511790c0 declarations moved to *.c files
arpi
parents: 7180
diff changeset
21 void roq_decode_video(void *context, unsigned char *encoded,
a117511790c0 declarations moved to *.c files
arpi
parents: 7180
diff changeset
22 int encoded_size, mp_image_t *mpi);
4989
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
23
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
24 // to set/get/query special features/parameters
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
25 static int control(sh_video_t *sh,int cmd,void* arg,...){
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
26 return CONTROL_UNKNOWN;
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
27 }
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
28
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
29 // init driver
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
30 static int init(sh_video_t *sh){
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
31 sh->context = roq_decode_video_init();
5124
3dcbf67c0de0 handle error from mpcodecs_config_vo()
arpi
parents: 4989
diff changeset
32 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
4989
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
33 }
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
34
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
35 // uninit driver
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
36 static void uninit(sh_video_t *sh){
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
37 }
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
38
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
39 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
40
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
41 // decode a frame
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
42 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
43 mp_image_t* mpi;
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
44 if(len<=0) return NULL; // skipped frame
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
45
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
46 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_IP, MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
47 sh->disp_w, sh->disp_h);
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
48 if(!mpi) return NULL;
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
49
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
50 roq_decode_video(sh->context, data, len, mpi);
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
51
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
52 return mpi;
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
53 }