Thread: Avisynth+
View Single Post
Old 12th January 2017, 10:48   #2847  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
This is what I found.

VideoInfo struct, defined in Avisynth.h has an image_type property.
It is a bitmap, we have 32 bits for storing video related properties.
This is where BFF, TFF, and FIELDBASED info is stored.

Single bit properties can be checked with VideoInfo::Is(property) function.

Checking for the few existing properties are directly implemented
VideoInfo::IsFieldBased()
VideoInfo::IsBFF()
VideoInfo::IsTFF()

VideoInfo::SetFieldBased(bool fieldbased) is a shortcut for set/clear FIELDBASED flag, something like this:
Code:
void VideoInfo::SetFieldBased(bool isfieldbased)  { if (isfieldbased) image_type|=IT_FIELDBASED; else  image_type&=~IT_FIELDBASED; }
One can set and clear a bit property as:
VideoInfo::Set(property) and VideoInfo::Clear(property)

In avisynth.h these are defined:
Code:
  // Imagetype properties

  int image_type;

  enum {
    IT_BFF = 1<<0,
    IT_TFF = 1<<1,
    IT_FIELDBASED = 1<<2
  };
Then there are some other defines, that are nowhere used. At least not inside avisynth plus.

Based on the CS_xxx naming, maybe these were originally intented to appear in the pixel_type. But as VideoInfo:: pixel_type is directly used for checking/setting the video format, using these chroma placement bits in pixel_type would break plugins and avisynth itself.

Code:
  // Chroma placement bits 20 -> 23  ::FIXME:: Really want a Class to support this
  enum {
    CS_UNKNOWN_CHROMA_PLACEMENT = 0 << 20,
    CS_MPEG1_CHROMA_PLACEMENT   = 1 << 20,
    CS_MPEG2_CHROMA_PLACEMENT   = 2 << 20,
    CS_YUY2_CHROMA_PLACEMENT    = 3 << 20,
    CS_TOPLEFT_CHROMA_PLACEMENT = 4 << 20
  };

Last edited by pinterf; 12th January 2017 at 10:50.
pinterf is offline