[][src]Enum libass_sys::ASS_YCbCrMatrix

#[repr(u32)]
pub enum ASS_YCbCrMatrix {
    YCBCR_DEFAULT,
    YCBCR_UNKNOWN,
    YCBCR_NONE,
    YCBCR_BT601_TV,
    YCBCR_BT601_PC,
    YCBCR_BT709_TV,
    YCBCR_BT709_PC,
    YCBCR_SMPTE240M_TV,
    YCBCR_SMPTE240M_PC,
    YCBCR_FCC_TV,
    YCBCR_FCC_PC,
}

Support for (xy-)vsfilter mangled colors

Generally, xy-vsfilter emulates the classic vsfilter behavior of rendering directly into the (usually YCbCr) video. vsfilter is hardcoded to use BT.601(TV) as target colorspace when converting the subtitle RGB color to the video colorspace. This led to major breakage when HDTV video was introduced: HDTV typically uses BT.709(TV), but vsfilter still used BT.601(TV) for conversion.

This means classic vsfilter will mangle colors as follows:

screen_rgb = bt_709tv_to_rgb(rgb_to_bt601tv(ass_rgb))

Or in general:

screen_rgb = video_csp_to_rgb(rgb_to_bt601tv(ass_rgb))

where video_csp is the colorspace of the video with which the subtitle was muxed.

xy-vsfilter did not fix this, but instead introduced explicit rules how colors were mangled by adding a "YCbCr Matrix" header. If this header specifies a real colorspace (like BT.601(TV) etc.), xy-vsfilter behaves exactly like vsfilter, but using the specified colorspace for conversion of ASS input RGB to screen RGB:

screen_rgb = video_csp_to_rgb(rgb_to_ycbcr_header_csp(ass_rgb))

Further, xy-vsfilter behaves like vsfilter with no changes if the header is missing.

The special value "None" means untouched RGB values. Keep in mind that some version of xy-vsfilter are buggy and don't interpret this correctly. It appears some people are advocating that this header value is intended for situations where exact colors do not matter.

Note that newer Aegisub versions (the main application to produce ASS subtitle scripts) have an option that tries not to mangle the colors. It is said that if the header is not set to BT.601(TV), the colors are supposed not to be mangled, even if the "YCbCr Matrix" header is not set to "None". In other words, the video colorspace as detected by Aegisub is the same as identified in the file header.

In general, misinterpreting this header or not using it will lead to slightly different subtitle colors, which can matter if the subtitle attempts to match solid colored areas in the video.

Note that libass doesn't change colors based on this header. It absolutely can't do that, because the video colorspace is required in order to handle this as intended by xy-vsfilter.

Variants

YCBCR_DEFAULTYCBCR_UNKNOWNYCBCR_NONEYCBCR_BT601_TVYCBCR_BT601_PCYCBCR_BT709_TVYCBCR_BT709_PCYCBCR_SMPTE240M_TVYCBCR_SMPTE240M_PCYCBCR_FCC_TVYCBCR_FCC_PC

Trait Implementations

impl PartialEq<ASS_YCbCrMatrix> for ASS_YCbCrMatrix[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Copy for ASS_YCbCrMatrix[src]

impl Clone for ASS_YCbCrMatrix[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Eq for ASS_YCbCrMatrix[src]

impl Hash for ASS_YCbCrMatrix[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for ASS_YCbCrMatrix[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]