annotate libmpcodecs/vd_msvidc.c @ 5101:870ba1ffdbf9

added mp_gettext macro for i18n
author alex
date Fri, 15 Mar 2002 21:07:48 +0000
parents f412b0110524
children 3dcbf67c0de0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4987
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
1 #include <stdio.h>
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
2 #include <stdlib.h>
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
3
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
4 #include "config.h"
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
5 #include "mp_msg.h"
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
6
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
7 #include "vd_internal.h"
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
8
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
9 static vd_info_t info = {
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
10 "Microsoft Video 1 / CRAM decoder",
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
11 "msvidc",
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
12 VFM_MSVIDC,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
13 "A'rpi",
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
14 "Mike Melanson",
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
15 "native codec"
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
16 };
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
17
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
18 LIBVD_EXTERN(msvidc)
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
19
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
20 // to set/get/query special features/parameters
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
21 static int control(sh_video_t *sh,int cmd,void* arg,...){
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
22 return CONTROL_UNKNOWN;
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
23 }
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
24
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
25 // init driver
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
26 static int init(sh_video_t *sh){
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
27 mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
28 return 1;
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
29 }
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
30
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
31 // uninit driver
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
32 static void uninit(sh_video_t *sh){
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
33 }
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
34
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
35 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
36
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
37 void AVI_Decode_Video1_16(
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
38 char *encoded,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
39 int encoded_size,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
40 char *decoded,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
41 int width,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
42 int height,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
43 int bytes_per_pixel);
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
44
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
45 void AVI_Decode_Video1_8(
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
46 char *encoded,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
47 int encoded_size,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
48 char *decoded,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
49 int width,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
50 int height,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
51 unsigned char *palette_map,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
52 int bytes_per_pixel);
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
53
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
54 // decode a frame
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
55 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
56 mp_image_t* mpi;
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
57 if(len<=0) return NULL; // skipped frame
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
58
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
59 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, MP_IMGFLAG_PRESERVE,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
60 sh->disp_w, sh->disp_h);
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
61 if(!mpi) return NULL;
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
62
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
63 if (sh->bih->biBitCount == 16)
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
64 AVI_Decode_Video1_16(
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
65 data, len, mpi->planes[0],
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
66 sh->disp_w, sh->disp_h,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
67 mpi->bpp/8);
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
68 else
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
69 AVI_Decode_Video1_8(
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
70 data, len, mpi->planes[0],
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
71 sh->disp_w, sh->disp_h,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
72 (unsigned char *)sh->bih+40,
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
73 mpi->bpp/8);
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
74
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
75 return mpi;
f412b0110524 fli and msvideo1 added
arpi
parents:
diff changeset
76 }