annotate libmpcodecs/vd_qtrpza.c @ 5189:c663455448e8

updates by Jiri.Svoboda@seznam.cz
author arpi
date Mon, 18 Mar 2002 23:20:13 +0000
parents 3dcbf67c0de0
children 28677d779205
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4915
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
1 #include <stdio.h>
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
2 #include <stdlib.h>
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
3
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
4 #include "config.h"
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
5 #include "mp_msg.h"
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
6
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
7 #include "vd_internal.h"
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
8
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
9 static vd_info_t info = {
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
10 "Quicktime Apple Video",
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
11 "qtrpza",
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
12 VFM_QTRPZA,
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
13 "Roberto Togni",
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
14 "Roberto Togni",
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
15 "native codec"
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
16 };
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
17
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
18 LIBVD_EXTERN(qtrpza)
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
19
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
20 // to set/get/query special features/parameters
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
21 static int control(sh_video_t *sh,int cmd,void* arg,...){
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
22 return CONTROL_UNKNOWN;
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
23 }
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
24
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
25 // init driver
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
26 static int init(sh_video_t *sh){
5124
3dcbf67c0de0 handle error from mpcodecs_config_vo()
arpi
parents: 4986
diff changeset
27 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR16);
4915
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
28 }
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
29
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
30 // uninit driver
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
31 static void uninit(sh_video_t *sh){
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
32 }
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
33
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
34 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
35
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
36 void qt_decode_rpza(char *encoded, int encodec_size, char *decodec, int width, int height, int bytes_per_pixel);
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
37
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
38 // decode a frame
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
39 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
40 mp_image_t* mpi;
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
41 if(len<=0) return NULL; // skipped frame
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
42
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
43 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, MP_IMGFLAG_PRESERVE, sh->disp_w, sh->disp_h);
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
44
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
45 if(!mpi){ // temporary!
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
46 printf("couldn't allocate image for qtrpza codec\n");
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
47 return NULL;
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
48 }
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
49
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
50 qt_decode_rpza(data, len, mpi->planes[0], sh->disp_w, sh->disp_h,
4948
869e5bff8dab optim :)
arpi
parents: 4915
diff changeset
51 mpi->bpp/8);
4915
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
52
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
53 return mpi;
f6990fad0ab3 Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
arpi
parents:
diff changeset
54 }