Skip to content

Commit

Permalink
Merge pull request #350 from rakslice/even_smaller_webm
Browse files Browse the repository at this point in the history
implement log2GobsPerBlockY values for even smaller images
  • Loading branch information
elFarto authored Jan 13, 2025
2 parents a419408 + 43bfe54 commit a0d4eaf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/direct/nv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ bool alloc_memory(const NVDriverContext *context, const uint32_t size, int *fd)
//first figure out the gob layout
uint32_t log2GobsPerBlockX = 0; //TODO not sure if these are the correct numbers to start with, but they're the largest ones i've seen used
uint32_t log2GobsPerBlockY = height < 86 ? 3 : 4; //TODO 86 is a guess, 80px high needs 3, 112px needs 4, 96px needs 4, 88px needs 4, 86px needs 4
if (height < 43) log2GobsPerBlockY = 2;
if (height < 22) log2GobsPerBlockY = 1;
if (height < 11) log2GobsPerBlockY = 0;
uint32_t log2GobsPerBlockZ = 0;

//LOG("Calculated GOB size: %dx%d (%dx%d)", gobWidthInBytes << log2GobsPerBlockX, gobHeightInBytes << log2GobsPerBlockY, log2GobsPerBlockX, log2GobsPerBlockY);
Expand Down

0 comments on commit a0d4eaf

Please sign in to comment.