Skip to content

Refactor swscale into new class + rename filtergraph and swscale constructs#1215

Merged
mollyxu merged 13 commits intometa-pytorch:mainfrom
mollyxu:refactor-swscale
Feb 18, 2026
Merged

Refactor swscale into new class + rename filtergraph and swscale constructs#1215
mollyxu merged 13 commits intometa-pytorch:mainfrom
mollyxu:refactor-swscale

Conversation

@mollyxu
Copy link
Copy Markdown
Contributor

@mollyxu mollyxu commented Feb 2, 2026

Refactor sw_scale into new class similar to what we did for filtergraph. (#1135)

  • Encapsulate the double swscale path (color conversion + resize) in a new SwScale class with a clean convert() API
  • Merge SwScaleContext and SwsFrameContext into a single SwsConfig struct (colorspace is now part of the config rather than a separate parameter)
  • Add encodingSwsContext_ for the encoding path, separating it from the decoding swscale which is now managed by SwScale

Rename filtergraph and swscale constructs in CpuDeviceInterface (#925)

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 2, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1215

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 640efe4 with merge base cc15044 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 2, 2026
@mollyxu mollyxu changed the title [wip] refactor swscale Refactor swscale into new class Feb 2, 2026
@mollyxu mollyxu marked this pull request as ready for review February 2, 2026 18:51
Comment thread src/torchcodec/_core/SwScale.cpp Outdated
Comment thread src/torchcodec/_core/SwScale.cpp Outdated
Comment thread src/torchcodec/_core/CpuDeviceInterface.cpp Outdated
Comment thread src/torchcodec/_core/CpuDeviceInterface.h Outdated
Comment thread src/torchcodec/_core/CpuDeviceInterface.h Outdated
Comment thread src/torchcodec/_core/CpuDeviceInterface.cpp Outdated
Copy link
Copy Markdown
Contributor

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mollyxu !

Comment thread src/torchcodec/_core/SwScale.cpp Outdated
Comment thread src/torchcodec/_core/SwScale.cpp Outdated
Comment thread src/torchcodec/_core/BetaCudaDeviceInterface.cpp
Comment thread src/torchcodec/_core/FFMPEGCommon.cpp Outdated
mollyxu and others added 4 commits February 13, 2026 14:28
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
@mollyxu mollyxu changed the title Refactor swscale into new class Refactor swscale into new class + rename filtergraph and swscale constructs Feb 13, 2026
@mollyxu mollyxu merged commit 6b683e8 into meta-pytorch:main Feb 18, 2026
87 of 88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants