Skip to content

Expose all sws flags for frame.reformat(interpolation=...) #2307

Description

@oakaigh

Currently pyav only exposes a limited number of flags (AND as enum.IntEnums RATHER THAN enum.IntFlags; so that needs to change as well - otherwise Interpolation is not useful):

class Interpolation(IntEnum):
FAST_BILINEAR: "Fast bilinear" = SWS_FAST_BILINEAR
BILINEAR: "Bilinear" = SWS_BILINEAR
BICUBIC: "2-tap cubic B-spline" = SWS_BICUBIC
X: "Experimental" = SWS_X
POINT: "Nearest neighbor / point" = SWS_POINT
AREA: "Area averaging" = SWS_AREA
BICUBLIN: "Bicubic luma / Bilinear chroma" = SWS_BICUBLIN
GAUSS: "Gaussian approximation" = SWS_GAUSS
SINC: "Unwindowed Sinc" = SWS_SINC
LANCZOS: "3-tap sinc/sinc" = SWS_LANCZOS
SPLINE: "Unwindowed natural cubic spline" = SWS_SPLINE

And other flags available (such as full_chroma_int, bitexact, accurate_rnd) are not exposed:
https://github.com/FFmpeg/FFmpeg/blob/44d082edc87381d978e8588b148116b99fefdb43/libswscale/options.c#L34-L54

Related discussion:
#1617

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions