We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3734 - Software YUV textures have duplicate color tables...
Summary: Software YUV textures have duplicate color tables...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: HG 2.0
Hardware: x86 Other
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-10 04:23 UTC by Ryan C. Gordon
Modified: 2019-10-23 09:35 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan C. Gordon 2017-08-10 04:23:24 UTC
When creating a YUV texture on the software renderer, we create a color table...

https://hg.libsdl.org/SDL/file/51aeabb61b2e/src/render/SDL_yuv_sw.c#l1077

...but this table is constant data that doesn't vary by texture. If we move this to a global that is allocated and initialized with the software renderer backend, we save 4 kilobytes per YUV texture and some needless processing.

(extra credit if we find out that it's cheaper to just calculate these values on the fly on modern CPUs than it is to use memory bandwidth on a lookup table.)
Comment 1 Sylvain 2017-09-20 18:51:46 UTC
changelog

Version 9b  17-Jan-2016
-----------------------

Improvements and optimizations in DCT and color calculations.
Normalize range limit array composition and access pattern.
Thank to Sia Furler and Maddie Ziegler for inspiration.

Use merged upsample with scaled DCT sizes larger than 8.
Thank to Taylor Hatala for inspiration.

Check for excessive comment lengths in argument parsing in wrjpgcom.c.
Thank to Julian Cohen for hint.

Add makefile.b32 for use with Borland C++ 32-bit (bcc32).
Thank to Joe Slater for contribution.

Document 'f' specifier for jpegtran -crop specification.
Thank to Michele Martone for suggestion.

Use defined value from header instead of hardwired number in rdswitch.c.
Thank to Robert Sprowson for hint.


Version 9a  19-Jan-2014
-----------------------

Add support for wide gamut color spaces (JFIF version 2).
Improve clarity and accuracy in color conversion modules.
Note: Requires rebuild of test images.

Extend the bit depth support to all values from 8 to 12
(BITS_IN_JSAMPLE configuration option in jmorecfg.h).
jpegtran now supports N bits sample data precision with all N from 8 to 12
in a single instance.  Thank to Roland Fassauer for inspiration.

Try to resolve issues with new boolean type definition.
Thank also to v4hn for suggestion.

Enable option to use default Huffman tables for lossless compression
(for hardware solution), and in this case improve lossless RGB compression
with reversible color transform.  Thank to Benny Alexandar for hint.

Extend the entropy decoding structure, so that extraneous bytes between
compressed scan data and following marker can be reported correctly.
Thank to Nigel Tao for hint.

Add jpegtran -wipe option and extension for -crop.
Thank to Andrew Senior, David Clunie, and Josef Schmid for suggestion.


Version 9  13-Jan-2013
----------------------
Comment 2 Sylvain 2017-09-20 18:54:02 UTC
Sorry, wrong ticket.
Comment 3 Sylvain 2019-10-23 09:35:43 UTC
the colortab was removed in a previous YUV improvement !
https://hg.libsdl.org/SDL/diff/cf166abbde4a/src/render/SDL_yuv_sw_c.h