[MPlayer-G2-dev] MID proposal

Ivan Kalvachev ivan at cacad.com
Sat Nov 1 21:03:08 CET 2003


Alex Beregszaszi said:
> Hi,
>
>> > A new idea: the new swscaler should based on a similar structure.
>>
>> new swscaler? r u dreaming? :)
> Yes, else I wouldn't code on opensource projects.
>
> --
> Alex Beregszaszi <alex at fsn.hu>
> (MPlayer Core Developer -- http://www.mplayerhq.hu/)
>
OK, I am constanly pointing the good side of XvImage
here is the structure, it is quite clear and quite overloaded,
strip it ;)
And don't worry, you wont become blind if you see it (once:)

typedef struct {
  int id;                      /* Unique descriptor for the format */
  int type;                    /* XvRGB, XvYUV */
  int byte_order;              /* LSBFirst, MSBFirst */
  char guid[16];               /* Globally Unique IDentifier */
  int bits_per_pixel;
  int format;                  /* XvPacked, XvPlanar */
  int num_planes;

  /* for RGB formats */
  int depth;
  unsigned int red_mask;
  unsigned int green_mask;
  unsigned int blue_mask;

  /* for YUV formats */
  unsigned int y_sample_bits;
  unsigned int u_sample_bits;
  unsigned int v_sample_bits;
  unsigned int horz_y_period;
  unsigned int horz_u_period;
  unsigned int horz_v_period;
  unsigned int vert_y_period;
  unsigned int vert_u_period;
  unsigned int vert_v_period;
  char component_order[32];    /* eg. UYVY */
  int scanline_order;          /* XvTopToBottom, XvBottomToTop */
} XvImageFormatValues;

OK here are my points:
1. merge some strucures so we wont' have different structures for
different formats (yuv,rgb)
2. _period and sample_bits could be in array.
3. samplebits is good for and e.g. RGB, but we will need and shift bits(e.g.
BGR565 B<<10 G <5 R<0 and G=g>>(8-samplebits[g_ofs])

4. component_order is nice idea. but donno how nv12 will be described;)
I had the idea to have recursive modes, but it will be too complicated.
5. rgb mask are good to have, some (sdl) releay on them
6. as MID will be static we could also add fourcc code, short name, long
name etc.... All stuff that will be used only once :)

Best Regards
   Ivan Kalvachev
  iive





More information about the MPlayer-G2-dev mailing list