shun-iwasawa 82a8f5
;
shun-iwasawa 82a8f5
; jdct.inc - private declarations for forward & reverse DCT subsystems
shun-iwasawa 82a8f5
;
shun-iwasawa 82a8f5
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB</ossman@cendio.se>
shun-iwasawa 82a8f5
; Copyright (C) 2018, D. R. Commander.
shun-iwasawa 82a8f5
;
shun-iwasawa 82a8f5
; Based on the x86 SIMD extension for IJG JPEG library
shun-iwasawa 82a8f5
; Copyright (C) 1999-2006, MIYASAKA Masaru.
shun-iwasawa 82a8f5
; For conditions of distribution and use, see copyright notice in jsimdext.inc
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
; Each IDCT routine is responsible for range-limiting its results and
shun-iwasawa 82a8f5
; converting them to unsigned form (0..MAXJSAMPLE).  The raw outputs could
shun-iwasawa 82a8f5
; be quite far out of range if the input data is corrupt, so a bulletproof
shun-iwasawa 82a8f5
; range-limiting step is required.  We use a mask-and-table-lookup method
shun-iwasawa 82a8f5
; to do the combined operations quickly.
shun-iwasawa 82a8f5
;
shun-iwasawa 82a8f5
%define RANGE_MASK  (MAXJSAMPLE * 4 + 3)  ; 2 bits wider than legal samples
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
%define ROW(n, b, s)  ((b) + (n) * (s))
shun-iwasawa 82a8f5
%define COL(n, b, s)  ((b) + (n) * (s) * DCTSIZE)
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
%define DWBLOCK(m, n, b, s) \
shun-iwasawa 82a8f5
  ((b) + (m) * DCTSIZE * (s) + (n) * SIZEOF_DWORD)
shun-iwasawa 82a8f5
%define MMBLOCK(m, n, b, s) \
shun-iwasawa 82a8f5
  ((b) + (m) * DCTSIZE * (s) + (n) * SIZEOF_MMWORD)
shun-iwasawa 82a8f5
%define XMMBLOCK(m, n, b, s) \
shun-iwasawa 82a8f5
  ((b) + (m) * DCTSIZE * (s) + (n) * SIZEOF_XMMWORD)
shun-iwasawa 82a8f5
%define YMMBLOCK(m, n, b, s) \
shun-iwasawa 82a8f5
  ((b) + (m) * DCTSIZE * (s) + (n) * SIZEOF_YMMWORD)
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
; --------------------------------------------------------------------------