copyright © 2003 texas instruments. all rights reserved. dsp c5000 chapter 18 image compression and...
Post on 14-Dec-2015
213 Views
Preview:
TRANSCRIPT
Copyright © 2003 Texas Instruments. All rights reserved.
DSP C5000DSP C5000
Chapter 18Chapter 18
Image Compression andImage Compression and
Hardware ExtensionsHardware Extensions
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 2
Image CompressionImage Compression
Discrete Cosine Transform (DCT) Discrete Cosine Transform (DCT) based compressionbased compression Still image: JPEG.Still image: JPEG.
Remove spatial redundancyRemove spatial redundancy
Video: H263, MPEG4.Video: H263, MPEG4. Remove spatial redundancyRemove spatial redundancy Remove temporal redundancyRemove temporal redundancy
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 3
JPEG EncoderJPEG Encoder Image is split into 8x8 pixel block that are Image is split into 8x8 pixel block that are
processed .processed .
DCT is applied on input block to obtain the DCT is applied on input block to obtain the frequency data.frequency data.
Values are read from low to high frequency Values are read from low to high frequency thanks to zig-zag addressing.thanks to zig-zag addressing.
Data are then quantized according to a quality Data are then quantized according to a quality factor.factor.
This output is then run length and entropy This output is then run length and entropy coded.coded.
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 4
JPEG DecoderJPEG Decoder
Data are entropy decoded.Data are entropy decoded. They are dequantized according to a quality They are dequantized according to a quality
factor.factor. Zig-zag addressing to re-order the data pixel by Zig-zag addressing to re-order the data pixel by
pixel.pixel. Inverse DCT to recover spatial data.Inverse DCT to recover spatial data.
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 5
H263 and MPEG4 encoderH263 and MPEG4 encoder Same basic building blocksSame basic building blocks
Hardware accelerator provided by C5509/10Hardware accelerator provided by C5509/10
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 6
H263 and MPEG4 DecoderH263 and MPEG4 Decoder Same basic building blocksSame basic building blocks
Hardware accelerator provided by C5509/10Hardware accelerator provided by C5509/10
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 7
Hardware ExtensionsHardware Extensions
‘‘C5509 and ‘C5510 provide H/W C5509 and ‘C5510 provide H/W extensions for video compression:extensions for video compression: DCT, IDCTDCT, IDCT Pixel interpolationPixel interpolation Motion estimationMotion estimation
Hardware extensions are embedded co-Hardware extensions are embedded co-processors:processors: Access to ACx, DARAM and SARAM.Access to ACx, DARAM and SARAM. Provide video codec with less than half of Provide video codec with less than half of
the processing bandwidth.the processing bandwidth.
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 8
DCT H/W Extension 1 of 5DCT H/W Extension 1 of 5
Allows 4x4 and 8x8 pixels DCT/IDCT Allows 4x4 and 8x8 pixels DCT/IDCT computation:computation: 2D DCT2D DCT
2D IDCT 2D IDCT
7
0
7
0 16
12cos
16
12cos),(
4),(
x y
vxuxyxi
vuvuI
else
zifz
vxuxvuI
vuyxi
u v
1
02/1
16
12cos
16
12cos),(
4),(
7
0
7
0
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 9
DCT H/W Extension 2 of 5DCT H/W Extension 2 of 5
Basic steps to complete a 2D Basic steps to complete a 2D DCT/IDCT:DCT/IDCT: Input Data: macro block (4x4 or 8x8) is Input Data: macro block (4x4 or 8x8) is
read in (DCT). DCT coefficient matrix is read in (DCT). DCT coefficient matrix is read in (IDCT).read in (IDCT).
Column DCT/IDCT process: output to Column DCT/IDCT process: output to temporary registers that will be transposed temporary registers that will be transposed for Row processing.for Row processing.
Row DCT/IDCT process: data read from Row DCT/IDCT process: data read from temporary register which are processed temporary register which are processed column by column.column by column.
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 10
DCT H/W Extension 3 of 5DCT H/W Extension 3 of 5
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 11
DCT H/W Extension 4 of 5DCT H/W Extension 4 of 5
Instruction set:Instruction set: Load+computation+transfer to accumulator:Load+computation+transfer to accumulator:
ACy=copr(k8,ACx,Xmem,Ymem)ACy=copr(k8,ACx,Xmem,Ymem) Computation+transfer to accumulator+memory Computation+transfer to accumulator+memory
write:write:
ACy=copr(k8,ACx,ACy),Lmem=AczACy=copr(k8,ACx,ACy),Lmem=Acz Special instructions: Special instructions:
ACy=copr(k8,ACx,ACy)ACy=copr(k8,ACx,ACy) Refer to Refer to application noteapplication note for details and listings for details and listings
of macros realizing complete 8x8 DCT/IDCT.of macros realizing complete 8x8 DCT/IDCT.
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 12
DCT H/W Extension 5 of 5DCT H/W Extension 5 of 5
H/W extensions can be used through C-H/W extensions can be used through C-callable functions provided by callable functions provided by IMLIBIMLIB
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 13
DebugDebug•To look at the internal register of the hardware extension …To look at the internal register of the hardware extension …
DCT and IDCT DCT and IDCT
Hardware accelerator Hardware accelerator
registersregisters
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 14
Tutorial DCT/IDCT with IMLIBTutorial DCT/IDCT with IMLIB
Describe step by step how to use H/W Describe step by step how to use H/W extensions with IMLIB.extensions with IMLIB.
Requires installation of Requires installation of IMLIBIMLIB before before continuing.continuing.
Requires special memory configuration Requires special memory configuration to obtain optimum performance.to obtain optimum performance.
CCS allows display of image contained CCS allows display of image contained in DSP memory.in DSP memory.
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 15
Memory ConfigurationMemory Configuration
dct.cmddct.cmd
hwdct.cdbhwdct.cdb
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 16
Display Input Image 1 of 2Display Input Image 1 of 2
Load hwdct.pjtLoad hwdct.pjt Build and load applicationBuild and load application Input image is « goldhill » 128x128 Input image is « goldhill » 128x128
which is included by the header file which is included by the header file ((#include «imagesample.h»#include «imagesample.h») at the ) at the address address goldhillgoldhill
To have the internal memory initialized To have the internal memory initialized use use Debug>go to mainDebug>go to main command. command.
You are now ready to display the input You are now ready to display the input image using image using view>Graph>imageview>Graph>image
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 17
Display Input Image 2 of 2Display Input Image 2 of 2
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 18
In place DCT ComputationIn place DCT Computation
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 19
Actual Actual dct.cdct.c Program Program
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 20
Output Display and InitializationOutput Display and Initialization
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 21
Output Buffer UpdateOutput Buffer Update
Copyright © 2003 Texas Instruments. All rights reserved.
ESIEE, Slide 22
ReferencesReferences JPEG for digital panel JPEG for digital panel ((SPRA664SPRA664))
TMS320C55x Hardware extensions for TMS320C55x Hardware extensions for image/video applications - Programmer’s image/video applications - Programmer’s reference reference ((SPRU098SPRU098))
TMS320C55x image/video processing TMS320C55x image/video processing library programmer’s reference library programmer’s reference ((SPRU037SPRU037))
top related