ﺑﺎﺳﻤﻪ ﺗﻌﺎﻟﯽ ﺳﯿﺴﺘﻢﻫﺎي ﭼﻨﺪرﺳﺎﻧﻪاي )(40-342 داﻧﺸﮑﺪه ﻣﻬﻨﺪﺳﯽ ﮐﺎﻣﭙﯿﻮﺗﺮ ﺗﺮم ﺑﻬﺎر 1387 دﮐﺘﺮ ﺣﻤﯿﺪرﺿﺎ رﺑﯿﻌﯽ ﺗﮑﻠﯿﻒ ﺷﻤﺎره :5ﻓﺸﺮده ﺳﺎزي ﺗﺼﻮﯾﺮ -1ﻣﻘﺪﻣﻪ ﻳﻚ ﺗﺼﻮﻳﺮ ﺩﻳﺠﻴﺘﺎﻝ ﺑﻪ ﺩﺳﺖ ﺁﻣﺪﻩ ﺑﺎ ﻧﻤﻮﻧﻪﺑﺮﺩﺍﺭﻱ ﻭ ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﻳﻚ ﻋﻜﺲ ﻣﻌﻤﻮﻟﻲ ،ﻓﻀﺎﻱ ﺫﺧﻴﺮﻩﺳﺎﺯﻱ ﺯﻳﺎﺩﻱ ﺭﺍ ﻧﻴﺎﺯ ﺩﺍﺭﺩ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ،ﻳﻚ ﺗﺼﻮﻳﺮ ﺭﻧﮕﻲ ٥١٢*٥١٢ﻛﻪ ﺭﻧﮓ ﻫﺮ ﭘﻴﻜﺴﻞ ﺭﺍ ﺑﺎ ٢٤ﺑﻴﺖ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ ٧٦٨ ،ﻛﻴﻠﻮﺑﺎﻳﺖ ﺍﺯ ﺣﺠﻢ ﻳﻚ ﺩﻳﺴﻚ ﺭﺍ ﺍﺷﻐﺎﻝ ﻣﻲ ﻛﻨﺪ ﻭ ﻋﻜﺴﻲ ﺑﺎ ﺍﻧﺪﺍﺯﻩ ﺩﻭ ﺑﺮﺍﺑﺮ ﻋﻜﺲ ﻗﺒﻠﻲ ﺑﺮ ﺭﻭﻱ ﻳﻚ ﺩﻳﺴﻜﺖ ﻧﺮﻡ ﺟﺎ ﻧﻤﻲﺷﻮﺩ .ﺑﺮﺍﻱ ﺍﻧﺘﻘﺎﻝ ﭼﻨﻴﻦ ﺗﺼﻮﻳﺮﻱ ﺑﺎ ﻳﻚ ﻣﻮﺩﻡ kbps ٢٨/٨ﺑﻪ ﺣﺪﻭﺩ ٤ﺩﻗﻴﻘﻪ ﺯﻣﺎﻥ ﻧﻴﺎﺯ ﺍﺳﺖ .ﻫﺪﻑ ﺍﺯ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﺗﺼﻮﻳﺮ ﻛﺎﻫﺶ ﻣﻴﺰﺍﻥ ﺩﺍﺩﻩﻫﺎﻱ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﻧﺸﺎﻥ ﺩﺍﺩﻥ ﺗﺼﺎﻭﻳﺮ ﺩﻳﺠﻴﺘﺎﻝ ﻭ ﺑﻨﺎﺑﺮﺍﻳﻦ ﻛﺎﻫﺶ ﻫﺰﻳﻨﻪ ﺍﻧﺘﻘﺎﻝ ﻭ ﺫﺧﻴﺮﻩ ﺳﺎﺯﻱ ﻣﻲﺑﺎﺷﺪ .ﻓﺸﺮﺩﻩﺳﺎﺯﻱ ﺗﺼﻮﻳﺮ ﻧﻘﺶ ﻛﻠﻴﺪﻱ ﺩﺭ ﺑﺴﻴﺎﺭﻱ ﺍﺯ ﻛﺎﺭﺑﺮﺩﻫﺎﻱ ﻣﻬﻢ ﺩﺍﺭﺍﺳﺖ .ﺍﻳﻦ ﻛﺎﺭﺑﺮﺩﻫﺎ ﺷﺎﻣﻞ ﭘﺎﻳﮕﺎﻩ ﺩﺍﺩﻩ ﺗﺼﻮﻳﺮ ،ﻣﺨﺎﺑﺮﻩ ﺗﺼﻮﻳﺮ ،ﺳﻨﺠﺶ ﺍﺯ ﺭﺍﻩ ﺩﻭﺭ )ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺗﺼﺎﻭﻳﺮ ﻣﺎﻫﻮﺍﺭﻩ ﺍﻱ ﺑﺮﺍﻱ ﻛﺎﺭﺑﺮﺩﻫﺎﻱ ﺁﺏ ﻭ ﻫﻮﺍ ﻳﺎ ﻣﻨﺎﺑﻊ ﺯﻳﺮﺯﻣﻴﻨﻲ( ،ﺗﺼﻮﻳﺮﺑﺮﺩﺍﺭﻱ ﺍﺳﻨﺎﺩ ،ﺗﺼﻮﻳﺮ ﺑﺮﺩﺍﺭﻱ ﭘﺰﺷﻜﻲ ،ﺍﻧﺘﻘﺎﻝ ﺗﻮﺳﻂ ﺩﻭﺭﻧﮕﺎﺭ ،ﻛﻨﺘﺮﻝ ﻭﺳﺎﻳﻞ ﻧﻘﻠﻴﻪ ﻧﻈﺎﻣﻲ ﻭ ﻓﻀﺎﻳﻲ ﺍﺯ ﺭﺍﻩ ﺩﻭﺭ ﻭ ﻛﻨﺘﺮﻝ ﺯﺑﺎﻟﻪﻫﺎﻱ ﺧﻄﺮﻧﺎﻙ ﻛﺎﺭﺑﺮﺩ ﺩﺍﺭﺩ .ﺑﻪ ﻃﻮﺭ ﺧﻼﺻﻪ ،ﻛﺎﺭﺑﺮﺩﻫﺎﻱ ﺭﻭﺯﺍﻓﺰﻭﻥ ﭘﺮﺩﺍﺯﺵ ﺗﺼﻮﻳﺮ ،ﺑﻪ ﺩﺳﺘﻜﺎﺭﻱ ،ﺫﺧﻴﺮﻩ ﺳﺎﺯﻱ ﻭ ﺍﻧﺘﻘﺎﻝ ﺗﺼﺎﻭﻳﺮ ﺩﻭﺩﻭﻳﻲ ،ﺳﻴﺎﻩ ﺳﻔﻴﺪ ﻳﺎ ﺭﻧﮕﻲ ﺑﻪ ﺷﻜﻠﻲ ﻛﺎﺭﺍ ﻭ ﻣﺆﺛﺮ ﺑﺴﺘﮕﻲ ﺩﺍﺭﺩ. ﻳﻜﻲ ﺍﺯ ﻣﻬﻤﺘﺮﻳﻦ ﭘﻴﺸﺮﻓﺖﻫﺎ ﺩﺭ ﻓﺸﺮﺩﻩﺳﺎﺯﻱ ﺗﺼﻮﻳﺮ ،ﺗﺄﺳﻴﺲ ﺍﺳﺘﺎﻧﺪﺍﺭﺩ JPEGﺑﺮﺍﻱ ﻓﺸﺮﺩﻩﺳﺎﺯﻱ ﺗﺼﺎﻭﻳﺮ ﺭﻧﮕﻲ ﺑﻮﺩ .ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺭﻭﺵ ،JPEGﻳﻚ ﺗﺼﻮﻳﺮ ﺭﻧﮕﻲ ٢٤ﭘﻴﻜﺴﻞ/ﺑﻴﺖ ﻣﻲﺗﻮﺍﻧﺪ ﺑﻪ ١ﺗﺎ ٢ﭘﻴﻜﺴﻞ/ﺑﻴﺖ ﺗﻘﻠﻴﻞ ﭘﻴﺪﺍ ﻛﻨﺪ .ﭼﻨﻴﻦ ﻛﺎﻫﺸﻲ ،ﺫﺧﻴﺮﻩ ﺳﺎﺯﻱ ﻭ ﺍﻧﺘﻘﺎﻝ ﺗﺼﺎﻭﻳﺮ ﻣﺎﻫﻮﺍﺭﻩﺍﻱ ﺭﺍ ﺑﺎ ﻫﺰﻳﻨﻪﺍﻱ ﻣﻌﻘﻮﻝ ﻣﻤﻜﻦ ﻣﻲﺳﺎﺯﺩ ،ﺑﺪﻭﻥ ﺍﻳﻨﻜﻪ ﺁﺭﺗﻴﻔﻜﺖﻫﺎﻱ ﺁﺷﻜﺎﺭ ﻗﺎﺑﻞ ﻣﺸﺎﻫﺪﻩ ﺍﻳﺠﺎﺩ ﻛﻨﺪ .ﺍﻳﻦ ﻛﺎﺭ ﻫﻤﭽﻨﻴﻦ ﺍﻣﻜﺎﻥ ﺫﺧﻴﺮﻩ ﺳﺎﺯﻱ ﻳﻚ ﻋﻜﺲ ﺭﻧﮕﻲ ﺭﺍ ﺍﺯ ﺭﻭﻱ ﺍﻳﻨﺘﺮﻧﺖ ﺩﺭ ﺯﻣﺎﻧﻲ ﺣﺪﻭﺩ ﻳﻚ ﻟﺤﻈﻪ ﻓﺮﺍﻫﻢ ﻣﻲ ﻛﻨﺪ ﻭ ﺑﻨﺎﺑﺮﺍﻳﻦ ﺍﻧﺘﺸﺎﺭ ﻭ ﺗﺒﻠﻴﻐﺎﺕ ﺑﺮ ﺭﻭﻱ ﺷﺒﻜﻪ ﺟﻬﺎﻧﻲ ﺍﻳﻨﺘﺮﻧﺖ ﺑﻪ ﻳﻚ ﻭﺍﻗﻌﻴﺖ ﺗﺒﺪﻳﻞ ﻣﻲﺷﻮﺩ .ﻗﺒﻞ ﺍﺯ ﺍﺳﺘﺎﻧﺪﺍﺭﺩ ،JPEGﺍﺳﺘﺎﻧﺪﺍﺭﺩﻫﺎﻱ G3ﻭ G4ﺑﺮﺍﻱ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﺍﺳﻨﺎﺩ ﺩﻭﺭﻧﮕﺎﺭ ،ﻛﺎﻫﺶ ﺯﻣﺎﻥ ﺍﻧﺘﻘﺎﻝ ﻳﻚ ﺻﻔﺤﻪ ﻣﺘﻨﻲ ﺍﺯ ﺣﺪﻭﺩ ٦ﺩﻗﻴﻘﻪ ﺑﻪ ﻳﻚ ﺩﻗﻴﻘﻪ ﺭﺍ ﻣﻤﻜﻦ ﺳﺎﺧﺘﻪ ﺑﻮﺩ. ﺩﺭ ﺍﻳﻦ ﺁﺯﻣﺎﻳﺶ ،ﺍﺻﻮﻝ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﺗﺼﻮﻳﺮ ﺑﺮﺍﻱ ﺗﺼﺎﻭﻳﺮ ﺩﻭﺩﻭﻳﻲ ،ﺳﻴﺎﻩ ﺳﻔﻴﺪ ﻭ ﺭﻧﮕﻲ ﻣﻌﺮﻓﻲ ﺧﻮﺍﻫﺪ ﺷﺪ .ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﻭﻳﺪﻳﻮ ﺩﺭ ﺁﺯﻣﺎﻳﺶ ﺑﻌﺪﻱ ﺑﺮﺭﺳﻲ ﺧﻮﺍﻫﺪ ﺷﺪ. -٢ﺗﺌﻮري ﻫﺎ و ﺗﮑﻨﯿﮏ ﻫﺎي ﻓﺸﺮدهﺳﺎزي ﺗﺼﻮﯾﺮ ﺑﻪ ﻃﻮﺭ ﻛﻠﻲ ،ﺭﻭﺵ ﻫﺎﻱ ﻛﺪﻳﻨﮓ ﻣﻲ ﺗﻮﺍﻧﻨﺪ ﺑﻪ ﺩﻭ ﺩﺳﺘﻪ ﺑﺪﻭﻥ ﺗﻠﻔﺎﺕ ﻭ ﺑﺎ ﺗﻠﻔﺎﺕ ﺗﻘﺴﻴﻢ ﺑﻨﺪﻱ ﺷﻮﻧﺪ .ﺩﺭ ﻛﺪﻳﻨﮓ ﺑﺪﻭﻥ ﺗﻠﻔﺎﺕ ،ﻣﻘﺎﺩﻳﺮ ﻧﻤﻮﻧﻪ ﻫﺎﻱ ﺍﺻﻠﻲ ﺩﻭﺑﺎﺭﻩ ﺩﻗﻴﻘﺎﹰ ﺑﻪ ﺩﺳﺖ ﻣﻲ ﺁﻳﻨﺪ ﻭ ﻓﺸﺮﺩﻩﺳﺎﺯﻱ ﺑﻮﺳﻴﻠﻪ ﭘﻴﺪﺍ ﻛﺮﺩﻥ ﺯﻭﺍﻳﺪ ﺁﻣﺎﺭﻱ ﺳﻴﮕﻨﺎﻝ ﺍﻧﺠﺎﻡ ﻣﻲ ﺷﻮﺩ .ﺩﺭ ﻛﺪﻳﻨﮓ ﺑﺎ ﺗﻠﻔﺎﺕ ،ﺳﻴﮕﻨﺎﻝ ﺍﺻﻠﻲ ﺗﺎ ﺣﺪﻭﺩﻱ ﺗﻐﻴﻴﺮ ﻣﻲ ﻛﻨﺪ ﻭﻟﻲ ﺑﻪ ﻧﺮﺥ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﺑﺎﻻﺗﺮﻱ ﺩﺳﺖ ﻣﻲ ﻳﺎﺑﻴﻢ. ﭘﺮﺩﺍﺯﺵ ﺑﻪ ﻛﺎﺭ ﮔﺮﻓﺘﻪ ﺷﺪﻩ ﺩﺭ ﺳﻴﺴﺘﻢ ﻛﺪﻳﻨﮓ ﺑﺎ ﺗﻠﻔﺎﺕ ﺩﺭ ﺷﻜﻞ ١ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ .ﻣﻲﺑﻴﻨﻴﻢ ﻛﻪ ﺳﻴﮕﻨﺎﻝ ﺩﺭ ﺍﺑﺘﺪﺍ ﺑﻪ ﻣﻴﺪﺍﻥ ﺗﺒﺪﻳﻞ ﻣﻲ ﺭﻭﺩ ﻛﻪ ﺑﺮﺍﻱ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﻣﻨﺎﺳﺐ ﺗﺮ ﺍﺳﺖ .ﺳﭙﺲ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺗﺒﺪﻳﻞ ﻛﻮﺍﻧﺘﻴﺰﻩ ﻣﻲﺷﻮﻧﺪ .ﺩﺭ ﺍﻧﺘﻬﺎ ،ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﻛﻮﺍﻧﺘﻴﺰﻩ ﺷﺪﻩ ﺑﻪ ﺻﻮﺭﺕ ﺑﺪﻭﻥ ﺗﻠﻔﺎﺕ ﺑﻪ ﺑﻴﺖ ﻫﺎﻱ ﺩﻭﺩﻭﻳﻲ ﻛﺪ ﻣﻲﺷﻮﻧﺪ .ﺩﺭ ﻛﺪﻳﻨﮓ ﺑﺪﻭﻥ ﺗﻠﻔﺎﺕ ،ﻣﺮﺣﻠﻪ ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﺍﻧﺠﺎﻡ ﻧﻤﻲﺷﻮﺩ. 1 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 ﺷﮑﻞ :1ﺑﻠﻮك دﯾﺎﮔﺮم ﯾﮏ ﺳﯿﺴﺘﻢ ﮐﺪﯾﻨﮓ ﻣﻌﻤﻮﻟﯽ -1-2ﮐﺪﯾﻨﮓ ﺑﺪون ﺗﻠﻔﺎت -1-1-2ﮐﺪﯾﻨﮓ ﺑﺪون ﺗﻠﻔﺎت ﺩﺭ ﻛﺪﻳﻨﮓ ﺑﺎ ﻃﻮﻝ ﻣﺘﻐﻴﺮ ) (VLCﺳﻤﺒﻮﻝ ﻫﺎﻳﻲ ﻛﻪ ﺍﺣﺘﻤﺎﻝ ﺣﻀﻮﺭﺷﺎﻥ ﺑﻴﺸﺘﺮ ﺍﺳﺖ ﺑﺎ ﺑﻴﺖ ﻫﺎﻱ ﻛﻤﺘﺮﻱ ﻧﻤﺎﻳﺶ ﺩﺍﺩﻩ ﻣﻲ ﺷﻮﻧﺪ )ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻳﻚ ﻛﻠﻤﻪ ﻛﺪ ﻛﻮﺗﺎﻫﺘﺮ( .ﻗﻀﻴﻪ ﺍﻃﻼﻋﺎﺕ ﺷﺎﻧﻮﻥ ] [١ﺑﻴﺎﻥ ﻣﻲ ﻛﻨﺪ ﻛﻪ ﻃﻮﻝ ﻣﻴﺎﻧﮕﻴﻦ ﺑﺮﺍﻱ ﻫﺮ ﺳﻤﺒﻮﻝ ، l ،ﺗﻮﺳﻂ ﺁﻧﺘﺮﻭﭘﻲ ﻣﻨﺒﻊ، ،Hﻣﺤﺪﻭﺩ ﻣﻲ ﺷﻮﺩ: p nﺍﺣﺘﻤﺎﻝ -nﺍﻣﻴﻦ ﺳﻤﺒﻮﻝ l n ،ﻃﻮﻝ ﻛﻠﻤﻪ ﻛﺪ nﻭ lﻃﻮﻝ ﻣﻴﺎﻧﮕﻴﻦ ﻛﻠﻤﻪ ﻛﺪ ﺍﺳﺖ H .ﺁﻧﺘﺮﻭﭘﻲ ﻣﻨﺒﻊ ﺍﺳﺖ ﻛﻪ ﺍﻃﻼﻋﺎﺕ ﻣﻴﺎﻧﮕﻴﻦ ﻣﻮﺟﻮﺩ ﺩﺭ ﻳﻚ ﻣﻨﺒﻊ ﺗﺼﺎﺩﻓﻲ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲ ﺩﻫﺪ. -2-1-2ﮐﺪﯾﻨﮓ ﻫﺎﻓﻤﻦ ﻗﻀﻴﻪ ﺷﺎﻧﻮﻥ ﺗﻨﻬﺎ ﻣﺤﺪﻭﺩﻩ ﺭﺍ ﻣﻲ ﺩﻫﺪ ﻭﻟﻲ ﺭﺍﻩ ﻋﻤﻠﻲ ﺗﺸﻜﻴﻞ ﻛﺪ ﺑﺮﺍﻱ ﺭﺳﻴﺪﻥ ﺑﻪ ﻣﺤﺪﻭﺩﻩ ﺭﺍ ﻧﻤﻲﺩﻫﺪ .ﭼﻨﻴﻦ ﻛﺎﺭﻱ ﺑﺎ ﺭﻭﺷﻲ ﻛﻪ ﺑﻪ ﻧﺎﻡ ﻛﺪﻳﻨﮓ ﻫﺎﻓﻤﻦ ﺷﻨﺎﺧﺘﻪ ﺷﺪﻩ ﺍﺳﺖ ﺻﻮﺭﺕ ﻣﻲ ﮔﻴﺮﺩ. ﻣﺜﺎﻝ :ﺗﺼﻮﻳﺮﻱ ﺭﺍ ﻛﻪ ﺑﻪ ٤ﺳﻄﺢ ﻛﻮﺍﻧﺘﻴﺰﻩ ﺷﺪﻩ ﺍﺳﺖ ﺩﺭ ﻧﻈﺮ ﺑﮕﻴﺮﻳﺪ ٢ ، ۱ ، ۰ :ﻭ ، ۳ﻓﺮﺽ ﻛﻨﻴﺪ ﺍﺣﺘﻤﺎﻝ ﺍﻳﻦ ﺳﻄﻮﺡ ﺑﻪ ﺗﺮﺗﻴﺐ ،۱/۴۹ ۳۶/۴۹ ،۴/۴۹ﻭ ۸/۴۹ﺑﺎﺷﺪ .ﻃﺮﺡ ﻛﺪ ﻫﺎﻓﻤﻦ ﺩﺭ ﺷﻜﻞ ٢ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ. ﺷﮑﻞ :2ﻣﺜﺎﻟﯽ از ﮐﺪﯾﻨﮓ ﻫﺎﻓﻤﻦ 2 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ،ﺩﺍﺭﻳﻢ: ﻃﻮﻝ ﻣﺘﻮﺳﻂ ﺁﻧﺘﺮﻭﭘﻲ ﻣﻨﺒﻊ ﺷﻜﻞ ۳ﻣﺜﺎﻝ ﺩﻳﮕﺮﻱ ﺍﺯﻛﺪﻳﻨﮓ ﻫﺎﻓﻤﻦ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ: ﺷﮑﻞ :3ﻣﺜﺎل دﯾﮕﺮي از ﮐﺪﯾﻨﮓ ﻫﺎﻓﻤﻦ -3-1-2روش ﻫﺎي دﯾﮕﺮ ﮐﺪﯾﻨﮓ ﺑﺎ ﻃﻮل ﻣﺘﻐﯿﺮ ﻛﺪﻳﻨﮓ [٢](Lempel, Ziv, Welsh) LZWﺍﻟﮕﻮﺭﻳﺘﻢ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﺩﺭ ﺑﺴﻴﺎﺭﻱ ﺍﺯ ﻧﺮﻡ ﺍﻓﺰﺍﺭﻫﺎﻱ ﻋﻤﻮﻣﻲ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﺍﻃﻼﻋﺎﺕ ﻣﺎﻧﻨﺪ gzipﻭ pkzipﺑﻮﺩﻩ ﺍﺳﺖ .ﻳﻜﻲ ﺍﺯ ﻣﺸﻬﻮﺭﺗﺮﻳﻦ ﻓﺮﻣﺖ ﻫﺎﻱ ﻓﺎﻳﻞ ﻫﺎﻱ ﮔﺮﺍﻓﻴﻜﻲ ) (GIFﻫﻢ ﺍﺯ ﻃﺮﺡ ﻛﺪﻳﻨﮓ LZWﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﻛﻨﺪ. ﺭﻭﺵ ﺷﻨﺎﺧﺘﻪ ﺷﺪﻩ ﺩﻳﮕﺮ ،ﺭﻭﺵ ﻛﺪﻳﻨﮓ ﺭﻳﺎﺿﻲ ] [٢ﺍﺳﺖ ﻛﻪ ﺍﺯ ﻛﺪﻳﻨﮓ LZWﻭ ﻫﺎﻓﻤﻦ ﻗﺪﺭﺗﻤﻨﺪ ﺗﺮ ﺍﺳﺖ ﻭﻟﻲ ﻣﺤﺎﺳﺒﺎﺕ ﺑﻴﺸﺘﺮﻱ ﻧﻴﺎﺯ ﺩﺍﺭﺩ. -4-1-2ﮐﺪﯾﻨﮓ RLCﺗﺼﺎوﯾﺮ دوﺳﻄﺤﯽ ﺩﺭ ﻛﺪﻳﻨﮓ RLCﻳﻚ ﺑﻌﺪﻱ ﺗﺼﺎﻭﻳﺮ ﺩﻭﺳﻄﺤﻲ ،ﭘﻴﻜﺴﻞ ﻫﺎ ﺍﺯ ﭼﭗ ﺑﻪ ﺭﺍﺳﺖ ﺩﺭ ﻫﺮ ﺧﻂ ﺍﺳﻜﻦ ،ﺍﺳﻜﻦ ﻣﻲ ﺷﻮﻧﺪ .ﻓﺮﺽ ﻛﻨﻴﺪ ﻛﻪ ﻫﺮ ﺧﻂ ،ﻫﻤﻴﺸﻪ ﺑﺎ ﭘﻴﻜﺴﻞ ﻫﺎﻱ ﺳﻔﻴﺪ ،ﺷﺮﻭﻉ ﻭ ﺧﺎﺗﻤﻪ ﻣﻲ ﻳﺎﺑﺪ ﻭ ﺩﺭ ﻫﺮ ﺍﺳﻜﻦ ،ﺑﻪ ﻧﻮﺑﺖ ﺗﻌﺪﺍﺩ ﺑﻴﺖ ﻫﺎﻱ ﭘﻴﻜﺴﻞ ﻫﺎﻱ ﺳﻔﻴﺪ ﻭ ﺳﻴﺎﻩ ﺷﻤﺮﺩﻩ 3 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 ﻣﻲ ﺷﻮﺩ ﻭ ﺁﺧﺮﻳﻦ ﻗﺴﻤﺖ ﭘﻴﻜﺴﻞ ﻫﺎﻱ ﺳﻔﻴﺪ ﺑﺎ ﻳﻚ ﺳﻤﺒﻮﻝ ﻣﺨﺼﻮﺹ ”) “EOLﺍﻧﺘﻬﺎﻱ ﺧﻂ( ﺟﺎﻳﮕﺰﻳﻦ ﻣﻲ ﺷﻮﺩ .ﻃﻮﻝ ﻗﻄﻌﺎﺕ ﺳﻔﻴﺪ ﻭ ﺳﻴﺎﻩ ﺑﺎ ﻛﺘﺎﺏ – ﻛﺪﻫﺎﻱ ﻣﺠﺰﺍ ﻛﺪ ﻣﻲ ﺷﻮﺩ .ﻛﺘﺎﺏ – ﻛﺪ ،ﻣﺜﻼﹰ ﺑﺮﺍﻱ ﻗﻄﻌﺎﺕ ﺳﻔﻴﺪ ﺗﻮﺳﻂ ﺭﻭﺵ ﻛﺪﻳﻨﮓ ﻫﺎﻓﻤﻦ ﻃﺮﺍﺣﻲ ﻣﻲ ﺷﻮﺩ .ﺑﺪﻳﻦ ﺷﻜﻞ ﻛﻪ ﻃﻮﻝ ﻫﺮ ﻗﻄﻌﻪ )ﺷﺎﻣﻞ (EOLﺑﻪ ﻋﻨﻮﺍﻥ ﺳﻤﺒﻮﻝ ﺩﺭ ﻧﻈﺮ ﮔﺮﻓﺘﻪ ﻣﻲ ﺷﻮﺩ .ﻳﻚ ﻣﺜﺎﻝ ﻛﺪﻳﻨﮓ RLCﺩﺭ ﺷﻜﻞ ٤ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ. ﺷﮑﻞ :4ﮐﺪﯾﻨﮓ Runlengthﺑﺮاي ﺗﺼﺎوﯾﺮ bi-level -5-1-2ﮐﺪﯾﻨﮓ RLCدو ﺑﻌﺪي ﻛﺪﻳﻨﮓ RLCﻳﻚ ﺑﻌﺪﻱ ﺗﻨﻬﺎ ﻫﻤﺒﺴﺘﮕﻲ ﻣﻴﺎﻥ ﭘﻴﻜﺴﻞ ﻫﺎﻱ ﻳﻚ ﺧﻂ ﺭﺍ ﺟﺴﺘﺠﻮ ﻣﻲﻛﻨﺪ .ﺩﺭ ﻛﺪﻳﻨﮓ RLCﺩﻭ ﺑﻌﺪﻱ ﻳﺎ ﻛﺪﻳﻨﮓ ﺁﺩﺭﺱ ﻧﺴﺒﻲ ،ﻫﻤﺒﺴﺘﮕﻲ ﻣﻴﺎﻥ ﭘﻴﻜﺴﻞ ﻫﺎ ﺩﺭ ﺧﻂ ﺣﺎﺿﺮ ﻭ ﻧﻴﺰ ﺧﻂ ﻗﺒﻠﻲ ﺟﺴﺘﺠﻮ ﻣﻲﺷﻮﺩ .ﺑﺎ ﺍﻳﻦ ﺭﻭﺵ ،ﻭﻗﺘﻲ ﺗﻐﻴﻴﺮﻱ ﺩﺭ ﺭﻧﮓ ﺭﻭﻱ ﻣﻲﺩﻫﺪ ﻓﺎﺻﻠﻪ ﺍﻳﻦ ﭘﻴﻜﺴﻞ ﺗﺎ ﻧﺰﺩﻳﻜﺘﺮﻳﻦ ﭘﻴﻜﺴﻠﻲ ﻛﻪ ﺩﺭ ﺁﻥ ﺗﻐﻴﻴﺮ ﺭﻭﻱ ﻣﻲﺩﻫﺪ )ﻫﻢ ﺑﻌﺪ ﻭ ﻫﻢ ﻗﺒﻞ ﺍﺯ ﺍﻳﻦ ﭘﻴﻜﺴﻞ( ،ﺩﺭ ﺧﻂ ﻗﺒﻠﻲ ﻭ ﻫﻤﻴﻦ ﻃﻮﺭ ﺁﺧﺮﻳﻦ ﭘﻴﻜﺴﻞ ﺩﺍﺭﺍﻱ ﺗﻐﻴﻴﺮﺍﺕ ﺩﺭ ﻫﻤﺎﻥ ﺧﻂ ﻣﺤﺎﺳﺒﻪ ﻣﻲﺷﻮﺩ ﻭ ﺁﻧﻜﻪ ﻓﺎﺻﻠﻪ ﻛﻮﺗﺎﻫﺘﺮﻱ ﺩﺍﺷﺖ ،ﺑﻪ ﻫﻤﺮﺍﻩ ﻳﻚ ﺍﻧﺪﻳﺲ ﻛﻪ ﻧﻮﻉ ﻓﺎﺻﻠﻪ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲ ﺩﻫﺪ ﻛﺪ ﻣﻲﺷﻮﺩ .ﺷﻜﻞ ٦-١٧ﺭﺍ ﺩﺭ ] [١ﺑﺒﻴﻨﻴﺪ. CCITT -6-1-2ﮔﺮوه 3و ﮔﺮوه 4اﺳﺘﺎﻧﺪارد ﮐﺪﯾﻨﮓ دورﻧﮕﺎر ،ﮐﺪ ،1] READﻓﺼﻞ (6 .6 ﺩﺭ ﺭﻭﺵﻫﺎﻱ ﮔﺮﻭﻩ ،٣ﺍﻭﻟﻴﻦ ﺧﻂ ﺩﺭ ﻫﺮ kﺧﻂ ﺑﺎ ﻛﺪﻳﻨﮓ RLCﻳﻚ ﺑﻌﺪﻱ ﻛﺪ ﻣﻲﺷﻮﺩ ﻭ k-1ﺧﻂ ﺑﺎﻗﻴﻤﺎﻧﺪﻩ ﺑﺎ ﻛﺪﻳﻨﮓ ٢ RLC ﺑﻌﺪﻱ ﻛﻪ ﺑﺎ ﻧﺎﻡ READ1ﺷﻨﺎﺧﺘﻪ ﻣﻲ ﺷﻮﺩ ،ﻛﺪ ﻣﻲﺷﻮﻧﺪ .ﺑﺮﺍﻱ ﺟﺰﻳﻴﺎﺕ ﺍﻳﻦ ﺭﻭﺵ ﻭ ﺟﺪﺍﻭﻝ ﻛﺪ ﻭﺍﻗﻌﻲ ،ﺑﺨﺶ [۱] ٦-٦-١ﺭﺍ ﺑﺒﻨﻴﺪ. ﺩﻟﻴﻞ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ RLCﻳﻚ ﺑﻌﺪﻱ ﺑﺮﺍﻱ ﻫﺮ kﺧﻂ ،ﺗﻀﻌﻴﻒ ﺍﻧﺘﺸﺎﺭ ﺧﻄﺎﻱ ﺍﻧﺘﻘﺎﻝ ﺍﺳﺖ .ﺩﺭ ﻏﻴﺮ ﺍﻳﻦ ﺻﻮﺭﺕ ﺩﺭ ﺻﻮﺭﺕ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺭﻭﺵ READﺑﻪ ﻃﻮﺭ ﭘﻴﻮﺳﺘﻪ ،ﻭﻗﺘﻲ ﻳﻚ ﺑﻴﺖ ﺧﻄﺎ ﺟﺎﻳﻲ ﺩﺭ ﺧﻼﻝ ﺍﻧﺘﻘﺎﻝ ﺭﻭﻱ ﺑﺪﻫﺪ ،ﺗﻤﺎﻡ ﺻﻔﺤﻪ ﺗﺄﺛﻴﺮ ﻣﻲﭘﺬﻳﺮﺩ. ﺭﻭﺵ ﮔﺮﻭﻩ ٤ﺑﺮﺍﻱ ﺭﺳﺎﻧﺔ ﺍﻧﺘﻘﺎﻝ ﺍﻣﻦﺗﺮ ﻃﺮﺍﺣﻲ ﺷﺪﻩ ﺍﺳﺖ ،ﻣﺎﻧﻨﺪ ﺧﻄﻮﻁ ﺩﺍﺩﺓ ﺍﺳﺘﻴﺠﺎﺭﻱ ) (leasedﻛﻪ ﻧﺮﺥ ﺧﻄﺎﻱ ﺑﺴﻴﺎﺭ ﻛﻮﭼﻜﻲ ﺩﺍﺭﻧﺪ .ﺍﻟﮕﻮﺭﻳﺘﻢ ﺷﻜﻞ ﺳﺎﺩﻩ ﺷﺪﻩﺍﻱ ﺍﺯ ﺭﻭﺵ ﮔﺮﻭﻩ ۳ﺍﺳﺖ ﻛﻪ RLCﻳﻚ ﺑﻌﺪﻱ ﺣﺬﻑ ﺷﺪﻩ ﺍﺳﺖ. Relative Element Address Designate 4 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 1 -2-2ﮐﺪﯾﻨﮓ ﭘﯿﺶ ﺑﯿﻨﯽ ﮐﻨﻨﺪه ﻣﻘﺪﺍﺭ ﭘﻴﻜﺴﻞ ﺣﺎﺿﺮ ﻣﻌﻤﻮﻻﹰ ﺗﻐﻴﻴﺮﺍﺕ ﺳﺮﻳﻌﻲ ﻧﺴﺒﺖ ﺑﻪ ﭘﻴﻜﺴﻞ ﻫﺎﻱ ﻣﺠﺎﻭﺭ ﻧﺪﺍﺭﺩ .ﺑﻨﺎﺑﺮﺍﻳﻦ ﻣﻲﺗﻮﺍﻧﺪ ﺍﺯ ﺭﻭﻱ ﻧﻤﻮﻧﻪ ﻫﺎﻱ ﻗﺒﻠﻲ ﭘﻴﺶﺑﻴﻨﻲ ﺷﻮﺩ .ﺑﻨﺎﺑﺮﺍﻳﻦ ،ﺑﻪ ﺟﺎﻱ ﻛﺪ ﻛﺮﺩﻥ ﭘﻴﻜﺴﻞ ﻫﺎﻱ ﺍﺻﻠﻲ ،ﻣﻲﺗﻮﺍﻥ ﭘﻴﻜﺴﻞ ﺣﺎﺿﺮ ﺭﺍ ﺍﺯ ﺭﻭﻱ ﻗﺒﻠﻲ ﻫﺎ ﭘﻴﺶ ﺑﻴﻨﻲ ﻛﺮﺩ ﻭ ﺗﻨﻬﺎ ﺧﻄﺎﻱ ﭘﻴﺶﺑﻴﻨﻲ ﺭﺍ ﻣﺸﺨﺺ ﻛﺮﺩ .ﺍﻳﺪﺓ ﻛﺪﻳﻨﮓ ﺑﺎ ﭘﻴﺶ ﺑﻴﻨﻲ ﻗﺒﻼﹰ ﺩﺭ ﻛﺪﻳﻨﮓ ﺻﺤﺒﺖ ﻭ ﺻﺪﺍ ﺍﺳﺘﻔﺎﺩﻩ ﺷﺪﻩ ﺍﺳﺖ .ﻛﺪﻳﻨﮓ ﭘﻴﺶ ﺑﻴﻨﻲ ﻛﻨﻨﺪﻩ ﻣﻲﺗﻮﺍﻧﻨﺪ ﺑﺎ ﺗﻠﻔﺎﺕ ﻳﺎ ﺑﺪﻭﻥ ﺗﻠﻔﺎﺕ ﺑﺎﺷﺪ ،ﺩﺭ ﻛﺪﻳﻨﮓ ﭘﻴﺶ ﺑﻴﻨﻲ ﻛﻨﻨﺪﻩ ﺑﺎ ﺗﻠﻔﺎﺕ ،ﺧﻄﺎﻱ ﭘﻴﺶﺑﻴﻨﻲ ﺍﺑﺘﺪﺍ ﻛﻮﺍﻧﺘﻴﺰﻩ ﺷﺪﻩ ﻭ ﺳﭙﺲ ﻛﺪ ﻣﻲﺷﻮﺩ .ﺩﻟﻴﻞ ﺍﻳﻦ ﻛﺎﺭ ﺍﻳﻦ ﺍﺳﺖ ﻛﻪ ﭘﻴﺶﺑﻴﻨﻲ ﺑﻪ ﺷﻜﻠﻲ ﻛﻪ ﺩﺭ ﺍﺩﺍﻣﻪ ﺧﻮﺍﻫﻴﻢ ﮔﻔﺖ ﺑﻪ ﻛﺎﻫﺶ ﻧﺮﺥ ﺑﻴﺖ ﻛﻤﻚ ﻣﻲﻛﻨﺪ .ﺧﻄﺎﻱ ﭘﻴﺶ ﺑﻴﻨﻲ ﺗﻮﺯﻳﻊ ﻏﻴﺮ ﻳﻜﻨﻮﺍﺧﺖ ﺧﻮﺍﻫﺪ ﺩﺍﺷﺖ ﻛﻪ ﻋﻤﺪﺗﺎﹰ ﺩﺭ ﻧﺰﺩﻳﻜﻲ ﺻﻔﺮ ﻣﺘﻤﺮﻛﺰ ﺍﺳﺖ ﻭ ﺁﻧﺘﺮﻭﭘﻲ ﻛﻤﺘﺮﻱ ﻧﺴﺒﺖ ﺑﻪ ﻧﻤﻮﻧﻪﻫﺎﻱ ﺍﺻﻠﻲ ﺩﺍﺭﺩ ﻛﻪ ﻣﻌﻤﻮﻻﹰ ﺗﻮﺯﻳﻊ ﻳﻜﻨﻮﺍﺧﺖ ﺩﺍﺭﻧﺪ .ﺑﺎ ﻛﺪﻳﻨﮓ ﺁﻧﺘﺮﻭﭘﻲ )ﻣﺜﻞ ﻛﺪﻳﻨﮓ ﻫﺎﻓﻤﻦ( ﻣﻘﺎﺩﻳﺮ ﺧﻄﺎ ﻣﻲ ﺗﻮﺍﻧﻨﺪ ﺑﺎ ﺑﻴﺖ ﻫﺎﻱ ﻛﻤﺘﺮﻱ ﻧﺴﺒﺖ ﺑﻪ ﻣﻘﺎﺩﻳﺮ ﻧﻤﻮﻧﻪ ﻫﺎﻱ ﺗﺼﻮﻳﺮ ﺍﺻﻠﻲ ﻛﺪ ﺷﻮﻧﺪ. ﺷﻜﻞ ٥ﺑﻠﻮﻙ ﺩﻳﺎﮔﺮﺍﻡ ﻛﻠﻲ ﺑﺮﺍﻱ ﻛﺪﮔﺬﺍﺭ ﻭ ﻛﺪ ﮔﺸﺎﻱ ﻳﻚ ﺳﻴﺴﺘﻢ ﻛﺪﻳﻨﮓ ﺑﺎ ﺗﻠﻔﺎﺕ ﭘﻴﺶ ﺑﻴﻨﻲ ﻛﻨﻨﺪﻩ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲ ﺩﻫﺪ .ﺩﺭ ﻳﻚ ﻛﺪ ﻛﻨﻨﺪﻩ ﺑﺪﻭﻥ ﺗﻠﻔﺎﺕ ،ﻣﺮﺣﻠﻪ ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﺍﻧﺠﺎﻡ ﻧﻤﻲﺷﻮﺩ .ﺷﻜﻞ ٦ﭼﮕﻮﻧﮕﻲ ﺍﺳﺘﻔﺎﺩﺓ ﻛﺪﻳﻨﮓ ﭘﻴﺶ ﺑﻴﻨﻲ ﻛﻨﻨﺪﻩ ﺑﺮﺍﻱ ﻳﻚ ﺗﺼﻮﻳﺮ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ. ﺷﮑﻞ :5ﺑﻠﻮك دﯾﺎﮔﺮام ﮐﻠﯽ ﺑﺮاي ﮐﺪﮔﺬار و ﮐﺪﮔﺸﺎي ﯾﮏ ﺳﯿﺴﺘﻢ ﮐﺪﯾﻨﮓ ﺑﺎ ﺗﻠﻔﺎت ﭘﯿﺶ ﺑﯿﻨﯽ ﮐﻨﻨﺪه ﺷﮑﻞ :6ﮐﺪﯾﻨﮓ ﭘﯿﺶ ﺑﯿﻨﯽ ﺷﺪه -3-2ﮐﺪﯾﻨﮓ ﺗﺒﺪﯾﻠﯽ )ﮐﺪﯾﻨﮓ ﺑﺎ ﺗﻠﻔﺎت( ] ،1ﻓﺼﻞ [6-5 ﻛﺪﻳﻨﮓ ﺑﺪﻭﻥ ﺗﻠﻔﺎﺕ ﻣﻲ ﺗﻮﺍﻧﺪ ﺑﻪ ﻧﺴﺒﺖ ﻫﺎﻱ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ٢ﺗﺎ ٣ﺑﺮﺍﻱ ﺑﻴﺸﺘﺮ ﺗﺼﺎﻭﻳﺮ ﺑﺮﺳﺪ .ﺑﺮﺍﻱ ﻛﺎﻫﺶ ﺑﻴﺸﺘﺮ ﻣﻘﺪﺍﺭ ﺩﺍﺩﻩﻫﺎ ،ﺭﻭﺵ ﻫﺎﻱ ﺑﺎ ﺗﻠﻔﺎﺕ ﻛﺪﻳﻨﮓ ،ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﺭﺍ ﺑﺮ ﺭﻭﻱ ﻣﻘﺎﺩﻳﺮ ﺗﺼﺎﻭﻳﺮ ﺍﺻﻠﻲ ﻳﺎ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﻣﻴﺪﺍﻥ ﺗﺒﺪﻳﻞ ﺳﻴﮕﻨﺎﻝ ﺍﺻﻠﻲ ﺑﻪ ﻛﺎﺭ ﻣﻲﺑﺮﻧﺪ .ﺗﺒﺪﻳﻞ ﺍﺯ ﻫﻤﺒﺴﺘﮕﻲ ﺁﻣﺎﺭﻱ ﻣﻴﺎﻥ ﻧﻤﻮﻧﻪﻫﺎﻱ ﺍﺻﻠﻲ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ .ﺭﻭﺵﻫﺎﻱ ﻣﺤﺒﻮﺏ ،ﺷﺎﻣﻞ ﭘﻴﺶ ﺑﻴﻨﻲ ﺧﻄﻲ ﻭ ﺗﺒﺪﻳﻞ ﻫﺎﻱ ﻳﻚ ﺑﻪ ﻳﻚ ﻣﻲﺑﺎﺷﺪ. ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ﺑﺮ ﺭﻭﻱ ﻛﺪﻳﻨﮓ ﺗﺒﺪﻳﻠﻲ ﻣﺘﻤﺮﻛﺰ ﻣﻲﺷﻮﻳﻢ ﻛﻪ ﺑﺮﺍﻱ ﺗﺼﺎﻭﻳﺮ ،ﻛﺎﺭﺍﻳﻲ ﺑﻴﺸﺘﺮﻱ ﺩﺍﺭﺩ. 5 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 ﻳﻜﻲ ﺍﺯ ﻣﺤﺒﻮﺑﺘﺮﻳﻦ ﺭﺍﻫﻜﺎﺭﻫﺎﻱ ﻛﺪﻳﻨﮓ ﺑﺎ ﺗﻠﻔﺎﺕ ﺑﺮﺍﻱ ﺗﺼﺎﻭﻳﺮ ،ﻛﺪﻳﻨﮓ ﺗﺒﺪﻳﻠﻲ ﺍﺳﺖ .ﺩﺭ ﻛﺪﻳﻨﮓ ﺗﺒﺪﻳﻠﻲ ﻣﺒﺘﻨﻲ ﺑﺮ ﺑﻠﻮﻙ ،ﺗﺼﻮﻳﺮ ﺑﻪ ﺑﻠﻮﻙﻫﺎﻱ ﺑﺪﻭﻥ ﻫﻤﭙﻮﺷﺎﻧﻲ ﺗﻘﺴﻴﻢ ﻣﻲ ﺷﻮﺩ .ﻫﺮ ﺑﻠﻮﻙ ﺑﺎ ﻣﺠﻤﻮﻋﻪ ﺍﻱ ﺍﺯ ﺍﻟﮕﻮﻫﺎﻱ ﭘﺎﻳﻪ ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﻣﻲ ﺷﻮﺩ) .ﻛﻪ ﺑﻪ ﻋﻨﻮﺍﻥ ﺗﻮﺍﺑﻊ ﭘﺎﻳﻪ ﺗﺒﺪﻳﻞ ﺷﻨﺎﺧﺘﻪ ﻣﻲﺷﻮﻧﺪ( )ﺷﻜﻞ (٧ﺳﻬﻢ ﻫﺮ ﺍﻟﮕﻮﻱ ﭘﺎﻳﻪ ﺑﻪ ﻋﻨﻮﺍﻥ ﺿﺮﻳﺐ ﺗﺒﺪﻳﻞ ﺷﻨﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ .ﺍﺯ ﻧﻈﺮ ﺭﻳﺎﺿﻲ ﺍﻳﻦ ﺿﺮﺍﻳﺐ ﺑﺎ ﻋﻤﻠﻴﺎﺕ ﻣﺎﺗﺮﻳﺴﻲ ﺑﻪ ﺩﺳﺖ ﻣﻲﺁﻳﻨﺪ .ﻣﻘﺎﺩﻳﺮ ﭘﻴﻜﺴﻞﻫﺎﻱ ﺍﺻﻠﻲ ﺩﺍﺧﻞ ﻫﺮ ﺑﻠﻮﻙ ،ﻳﻚ ﺑﺮﺩﺍﺭ ﺭﺍ ﺗﺸﻜﻴﻞ ﻣﻲ ﺩﻫﻨﺪ .ﺩﺭ ﺣﺎﻟﻲ ﻛﻪ ﺗﻤﺎﻡ ﺗﻮﺍﺑﻊ ﭘﺎﻳﻪ ﺗﺒﺪﻳﻞ، ﻳﻚ ﻣﺎﺗﺮﻳﺲ ﺭﺍ ﻣﻲﺳﺎﺯﻧﺪ .ﺑﺮﺩﺍﺭ ﺷﺎﻣﻞ ﺗﻤﺎﻡ ﺿﺮﺍﻳﺐ ﺗﺒﺪﻳﻞ ،ﺣﺎﺻﻠﻀﺮﺏ ﻣﺎﺗﺮﻳﺲ ﺗﺒﺪﻳﻞ ﺑﺎ ﺑﺮﺩﺍﺭ ﭘﻴﻜﺴﻞﻫﺎ ﺍﺳﺖ .ﺗﺒﺪﻳﻞ ﻃﻮﺭﻱ ﻃﺮﺍﺣﻲ ﺷﺪﻩ ﺍﺳﺖ ﻛﻪ ﺍﻧﺮﮊﻱ ﺳﻴﮕﻨﺎﻝ ﺍﺻﻠﻲ ﺗﻨﻬﺎ ﺩﺭ ﺿﺮﺍﻳﺐ ﻛﻤﻲ ﺟﻤﻊ ﺷﻮﺩ ﻭ ﻫﻤﺒﺴﺘﮕﻲ ﻣﻴﺎﻥ ﻣﺘﻐﻴﺮﻫﺎ ﺑﺮﺍﻱ ﻛﺪ ﺷﺪﻥ ﻛﺎﻫﺶ ﻳﺎﺑﺪ .ﻫﺮ ﺩﻭﻱ ﺍﻳﻦ ﻣﻮﺍﺭﺩ ﺑﻪ ﻛﺎﻫﺶ ﻧﺮﺥ ﺑﻴﺖ ﻛﻤﻚ ﻣﻲﻛﻨﻨﺪ .ﺷﻜﻞ ،٧ﺑﻮﺳﻴﻠﻪ ﺗﺒﺪﻳﻞ ﺑﻠﻮﻛﻲ ،ﻫﺮ ﺑﻠﻮﻙ ﺗﺼﻮﻳﺮ ﺭﺍ ﺑﻪ ﺻﻮﺭﺕ ﺗﺮﻛﻴﺐ ﺧﻄﻲ ﺑﻌﻀﻲ ﺍﻟﮕﻮﻫﺎﻱ ﭘﺎﻳﻪ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ. ﺷﮑﻞ :7ﺗﺮﮐﯿﺐ ﺧﻄﯽ ﺑﻌﻀﯽ اﻟﮕﻮﻫﺎي ﭘﺎﯾﻪ ﺷﻜﻞ ٨ﭘﺮﺩﺍﺯﺵ ﻳﻚ ﺑﻠﻮﻙ ﻛﺪﻳﻨﮕﻲ ﺗﺒﺪﻳﻠﻲ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲ ﺩﻫﺪ ﺍﺑﺘﺪﺍ ﺑﻠﻮﻙ ﻭﺭﻭﺩﻱ ﺍﺯ ﻃﺮﻳﻖ ﻳﻚ ﻋﻤﻠﮕﺮ ﻣﺎﺗﺮﻳﺴﻲ ﺗﺒﺪﻳﻞ ﻣﻲﺷﻮﺩ .ﺿﺮﺍﻳﺐ ﺗﺒﺪﻳﻞ ،ﺳﭙﺲ ﻛﻮﺍﻧﺘﻴﺰﻩ ﺷﺪﻩ ﻭ ﻛﺪ ﻣﻲﺷﻮﻧﺪ .ﺩﺭ ﻛﺪﮔﺸﺎ ،ﺑﻠﻮﻙ ﺍﺻﻠﻲ ﺍﺯ ﺭﻭﻱ ﺿﺮﺍﻳﺐ ﻛﻮﺍﻧﺘﻴﺰﻩ ﺷﺪﻩ ﺍﺯ ﻃﺮﻳﻖ ﻋﻜﺲ ﺗﺒﺪﻳﻞ ﺑﺎﺯﺳﺎﺯﻱ ﻣﻲﺷﻮﺩ. ﺷﮑﻞ :8ﭘﺮدازش ﯾﮏ ﺑﻠﻮك ﮐﺪﯾﻨﮕﯽ ﺗﺒﺪﯾﻠﯽ -1-3-2ﺗﺒﺪﯾﻞ ﮐﺴﯿﻨﻮﺳﯽ ﮔﺴﺴﺘﻪ )(DCT DCTﺑﺮﺍﻱ ﺳﻴﮕﻨﺎﻝ ﻫﺎﻱ ﺗﺼﻮﻳﺮ ،ﻣﺤﺒﻮﺏ ﺍﺳﺖ ،ﺯﻳﺮﺍ ﺑﻪ ﺧﻮﺑﻲ ﺑﺎ ﺧﺼﻮﺻﻴﺎﺕ ﺁﻣﺎﺭﻱ ﺳﻴﮕﻨﺎﻝﻫﺎﻱ ﺗﺼﻮﻳﺮ ﻣﻮﺟﻮﺩ ﻣﻨﻄﺒﻖ ﺍﺳﺖ. ﺑﺮﺩﺍﺭﻫﺎﻱ ﭘﺎﻳﻪ ﻳﻚ ﺑﻌﺪﻱ -Nﻧﻘﻄﻪ ﺍﻱ DCTﺑﺪﻳﻦ ﺻﻮﺭﺕ ﺗﻌﺮﻳﻒ ﻣﻲ ﺷﻮﻧﺪ: ﺗﺒﺪﻳﻞ ﻭ ﻋﻜﺲ ﺗﺒﺪﻳﻞ ﺑﺪﻳﻦ ﺻﻮﺭﺕ ﺗﻌﺮﻳﻒ ﻣﻲ ﺷﻮﻧﺪ: 6 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 ﺗﻮﺟﻪ ﻛﻨﻴﺪ ﻛﻪ ﺑﺮﺩﺍﺭﻫﺎﻱ ﭘﺎﻳﻪ ﺩﺭ ﺍﻟﮕﻮﻱ ﺳﻴﻨﻮﺳﻲ ﺑﺎ ﺍﻓﺰﺍﻳﺶ ﻓﺮﻛﺎﻧﺲ ،ﺗﻐﻴﻴﺮ ﻣﻲﻛﻨﻨﺪ .ﺗﻮﺟﻪ ﻛﻨﻴﺪ ﻛﻪ -N DCTﻧﻘﻄﻪﺍﻱ ﺑﻪ -٢N DFT ﻧﻘﻄﻪﺍﻱ ﻣﺮﺗﺒﻂ ﺍﺳﺖ ﻭﻟﻲ ﺟﺰﺀ ﺣﻘﻴﻘﻲ ﺁﻥ ﻧﻴﺴﺖ .ﻫﺮ ﺿﺮﻳﺐ DCTﺳﻬﻢ ﺍﻟﮕﻮﻱ ﺳﻴﻨﻮﺳﻲ ﺭﺍ ﺩﺭ ﻳﻚ ﻓﺮﻛﺎﻧﺲ ﻣﺸﺨﺺ ﺩﺭ ﺳﻴﮕﻨﺎﻝ ﺍﺻﻠﻲ ﻧﺸﺎﻥ ﻣﻲ ﺩﻫﺪ .ﻛﻮﭼﻜﺘﺮﻳﻦ ﺿﺮﻳﺐ ،ﻛﻪ ﺑﻪ ﻋﻨﻮﺍﻥ ﺿﺮﻳﺐ DCﺷﻨﺎﺧﺘﻪ ﻣﻲ ﺷﻮﺩ ،ﻣﻴﺎﻧﮕﻴﻦ ﻣﻘﺎﺩﻳﺮ ﺳﻴﮕﻨﺎﻝ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ .ﺑﻘﻴﻪ ﺿﺮﺍﻳﺐ ﻛﻪ ﺑﻪ ﻋﻨﻮﺍﻥ ﺿﺮﺍﻳﺐ ACﺷﻨﺎﺧﺘﻪ ﻣﻲ ﺷﻮﻧﺪ ،ﺑﻪ ﻓﺮﻛﺎﻧﺲﻫﺎﻱ ﺑﺎﻻﺗﺮ ﻣﺮﺗﺒﻂ ﻫﺴﺘﻨﺪ. ﺑﺮﺍﻱ ﺑﻪ ﺩﺳﺖ ﺁﻭﺭﺩﻥ ٢ DCTﺑﻌﺪﻱ ﺍﺯ ﻳﻚ ﺑﻠﻮﻙ ﺗﺼﻮﻳﺮ ،ﻓﺮﺩ ﻣﻲ ﺗﻮﺍﻧﺪ ﺩﺭ ﺍﺑﺘﺪﺍ DCTﻳﻚ ﺑﻌﺪﻱ ﺭﺍ ﺑﺮ ﺭﻭﻱ ﻫﺮ ﺭﺩﻳﻒ ﺑﻠﻮﻙ ﺗﺼﻮﻳﺮ ﺑﻪ ﻛﺎﺭ ﺑﺮﺩ ﻭ ﺳﭙﺲ DCTﻳﻚ ﺑﻌﺪﻱ ﺭﺍ ﺑﻪ ﺭﻭﻱ ﻫﺮ ﺳﺘﻮﻥ ﺑﻠﻮﻙ ﺣﺎﺻﻞ ﺍﻧﺠﺎﻡ ﺩﻫﺪ .ﻳﻚ ﺗﺒﺪﻳﻞ ٢ﺑﻌﺪﻱ ﻣﻌﺎﺩﻝ ﻧﻤﺎﻳﺶ ﺳﻴﮕﻨﺎﻝ ﺑﻮﺳﻴﻠﻪ ﺟﻤﻊ ﺗﻌﺪﺍﺩ ﺯﻳﺎﺩﻱ ﺍﻟﮕﻮﻫﺎﻱ ﭘﺎﻳﻪ ﺍﺳﺖ .ﺍﻟﮕﻮﻫﺎﻱ ﺑﻠﻮﻙ ﭘﺎﻳﻪ ﻣﻨﺘﺎﻇﺮ ﺑﺎ ٨*٨ DCTﺩﺭ ﺷﻜﻞ ٩ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ. ﺍﻳﻦ ﺷﻜﻞ ﺑﺎ ﺩﺳﺘﻮﺭﺍﺕ MATLABﺯﻳﺮ ﺑﻪ ﺩﺳﺖ ﺁﻣﺪﻩ ﺍﺳﺖ. ;)T=dctmtx2(8 ;figure; colormap(gray(256));n=1 )for (i=1:8 )for (j=1:8 subplot(8,8,n), ;))imagesc(T(i,:)'*T(j,: ;axis off; axis image ;n=n+1 ;end ;end ﺷﮑﻞ :9اﻟﮕﻮﻫﺎي ﺑﻠﻮك ﭘﺎﯾﻪ ﻣﻨﺘﺎﻇﺮ ﺑﺎ 8*8 DCT 7 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 -2-3-2ﻧﻤﺎﯾﺶ ﺑﻠﻮك ﻫﺎي ﺗﺼﻮﯾﺮ ﺑﺎ DCT ﺩﻟﻴﻞ ﻣﻨﺎﺳﺐ ﺑﻮﺩﻥ DCTﺑﺮﺍﻱ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﺗﺼﻮﻳﺮ ﺍﻳﻦ ﺍﺳﺖ ﻛﻪ ﻳﻚ ﺑﻠﻮﻙ ﺗﺼﻮﻳﺮ ﻣﻌﻤﻮﻻﹰ ﻣﻲﺗﻮﺍﻧﺪ ﺗﻮﺳﻂ ﺿﺮﺍﻳﺐ DCTﺑﺴﻴﺎﺭ ﻓﺮﻛﺎﻧﺲ ﭘﺎﻳﻴﻦ ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﻮﺩ. ﺍﻳﻦ ﻛﺎﺭ ﺑﻪ ﺍﻳﻦ ﺧﺎﻃﺮ ﺍﺳﺖ ﻛﻪ ﻣﻘﺎﺩﻳﺮ ﺷﺪﺕ ﺩﺭ ﻫﺮ ﺗﺼﻮﻳﺮ ﻣﻌﻤﻮﻻﹰ ﺑﻪ ﺻﻮﺭﺕ ﻫﻤﻮﺍﺭ ﺗﻐﻴﻴﺮ ﻣﻲ ﻛﻨﻨﺪ ﻭ ﻣﺆﻟﻔﻪﻫﺎﻱ ﻓﺮﻛﺎﻧﺲ ﺧﻴﻠﻲ ﺑﺎﻻ ﺗﻨﻬﺎ ﺩﺭ ﻧﺰﺩﻳﻜﻲ ﻟﺒﻪ ﻫﺎ ﻭﺟﻮﺩ ﺩﺍﺭﻧﺪ .ﺩﺭ ﺷﻜﻞ ١٠ﺗﻘﺮﻳﺐ ﻳﻚ ﺗﺼﻮﻳﺮ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺗﻌﺪﺍﺩ ﻣﺨﺘﻠﻔﻲ ﺍﺯ ﺿﺮﺍﻳﺐ DCTﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ. ﻣﻲﺗﻮﺍﻧﻴﻢ ﺑﺒﻴﻨﻴﻢ ﻛﻪ ﻓﻘﻂ ١٦ﺗﺎ ﺍﺯ ٦٤ﺿﺮﻳﺐ ﻣﻲ ﺗﻮﺍﻧﺪ ﺑﻪ ﺧﻮﺑﻲ ﺑﻠﻮﻙ ﺍﺻﻠﻲ ﺭﺍ ﻧﻤﺎﻳﺶ ﺩﻫﺪ ،ﺷﻤﺎ ﻣﻲﺗﻮﺍﻧﻴﺪ ﺩﻗﺖ ﺗﻘﺮﻳﺐ ﺿﺮﺍﻳﺐ ﺑﺎ ﺗﻌﺪﺍﺩ ﻣﺨﺘﻠﻒ DCTﺭﺍ ﺑﺎ ﺑﺮﻧﺎﻣﺔ dctdemo ،MATLABﺁﺯﻣﺎﻳﺶ ﻛﻨﻴﺪ. ﺷﮑﻞ :10ﺗﻘﺮﯾﺐ ﯾﮏ ﺗﺼﻮﯾﺮ ﺑﺎ اﺳﺘﻔﺎده از ﺗﻌﺪاد ﻣﺨﺘﻠﻔﯽ از ﺿﺮاﯾﺐ .DCTﭼﭗ-ﺑﺎﻻ :ﺷﮑﻞ اﺻﻠﯽ ﯾﺎ ﺗﻤﺎﻣﯽ ﺿﺮاﯾﺐ ،DCT راﺳﺖ-ﺑﺎﻻ 16/64 :ﺿﺮﯾﺐ ،ﭼﭗ-ﭘﺎﯾﯿﻦ 8/64 :ﺿﺮﯾﺐ ،راﺳﺖ-ﭘﺎﯾﯿﻦ 4/64 :ﺿﺮﯾﺐ. -3-3-2اﺳﺘﺎﻧﺪارد JPEGﺑﺮاي ﻓﺸﺮده ﺳﺎزي ﺗﺼﻮﯾﺮ ﺛﺎﺑﺖ ﺍﺳﺘﺎﻧﺪﺍﺭﺩ JPEGﺑﺮﺍﻱ ﻓﺸﺮﺩﻩﺳﺎﺯﻱ ﺗﺼﻮﻳﺮ ﺛﺎﺑﺖ ﺗﻮﺻﻴﻪ ﺷﺪﻩ ﺗﻮﺳﻂ ﮔﺮﻭﻩ ﻣﺘﺨﺼﺼﻴﻦ ﻋﻜﺲ ) ISOﺳﺎﺯﻣﺎﻥ ﺍﺳﺘﺎﻧﺪﺍﺭﺩﻫﺎﻱ ﺑﻴﻦﺍﻟﻤﻠﻠﻲ( ﺍﺯ ﺳﻪ ﺑﺨﺶ ﺗﺸﻜﻴﻞ ﻳﺎﻓﺘﻪ ﺍﺳﺖ: -١ﺭﻭﺵ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﺑﺎ ﺗﻠﻔﺎﺕ ﻣﺒﺘﻨﻲ ﺑﺮ DCTﺑﺮﺍﻱ ﺩﻗﺖ ﻭ ﺭﺯﻟﻮﺷﻦ ﺍﺳﺘﺎﻧﺪﺍﺭﺩ )٨bits/color/pixel (. -٢ﺭﻭﺵ ﻛﺪﻳﻨﮓ ﺗﻮﺳﻌﻪ ﻳﺎﻓﺘﻪ ﺑﺮﺍﻱ ﺗﺼﺎﻭﻳﺮ ﺑﺎ ﺩﻗﺖ ﻭ ﺭﺯﻟﻮﺷﻦ ﺑﺎﻻﺗﺮ ﻛﻪ ﺍﻟﮕﻮﺭﻳﺘﻢ ﻗﺒﻠﻲ ﺭﺍ ﺩﺭ ﺩﺍﺧﻞ ﺧﻮﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ. -۳ﺭﻭﺵ ﻛﺪﻳﻨﮓ ﭘﻴﺶ ﺑﻴﻨﻲ ﻛﻨﻨﺪﻩ ﺑﺪﻭﻥ ﺗﻠﻔﺎﺕ. ﺩﺭ ﺍﻳﻨﺠﺎ ﻣﺎ ﺗﻨﻬﺎ ﺍﻟﮕﻮﺭﻳﺘﻢ ﺍﻭﻝ ﺭﺍ ﻛﻪ ﺑﻴﺸﺘﺮ ﺍﺯ ﺑﻘﻴﻪ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ ﺗﻮﺿﻴﺢ ﻣﻲﺩﻫﻴﻢ .ﺩﺭ ﺍﺑﺘﺪﺍ ﺗﺼﻮﻳﺮ ﻭﺭﻭﺩﻱ ﺭﺍ ﺑﻪ ﺑﻠﻮﻙ ﻫﺎﻱ ٨*٨ﺑﺪﻭﻥ ﻫﻤﭙﻮﺷﺎﻧﻲ ﺗﻘﺴﻴﻢ ﻣﻲﻛﻨﻴﻢ .ﺳﭙﺲ ﻳﻚ ٨*٨ DCTﺑﺮ ﺭﻭﻱ ﻫﺮ ﺑﻠﻮﻙ ﺑﻪ ﻛﺎﺭ ﻣﻲﺭﻭﺩ .ﺑﺮﺍﻱ ﺿﺮﻳﺐ DCﻫﺮ ﺑﻠﻮﻙ ،ﺭﻭﺵ ﻛﺪﻳﻨﮓ ﭘﻴﺶ ﺑﻴﻨﻲ ﻛﻨﻨﺪﻩ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ ،ﻳﻌﻨﻲ ﻣﻘﺪﺍﺭ DCﺣﺎﺿﺮ ﺍﺯ ﺭﻭﻱ ﻣﻘﺪﺍﺭ DCﺑﻠﻮﻙ ﻗﺒﻠﻲ ﭘﻴﺶ ﺑﻴﻨﻲ ﻣﻲﺷﻮﺩ ﻭ ﺧﻄﺎﻱ ﭘﻴﺶ ﺑﻴﻨﻲ ﺑﺎ ﻳﻚ ﻛﻮﺍﻧﺘﻴﺰﻩ ﻛﻨﻨﺪﺓ ﻳﻜﻨﻮﺍﺧﺖ ﻛﻮﺍﻧﺘﻴﺰﻩ ﻣﻲﺷﻮﺩ .ﺿﺮﺍﻳﺐ ACﺩﻳﮕﺮ ﻣﺴﺘﻘﻴﻤﺎﹰ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻛﻮﺍﻧﺘﺎﻳﺰﺭﻫﺎﻱ ﻣﺨﺘﻠﻒ ،ﻛﻮﺍﻧﺘﻴﺰﻩ ﻣﻲ ﺷﻮﻧﺪ )ﺑﺎ ﺍﻧﺪﺍﺯﺓ ﭘﻠﻪ ﻫﺎﻱ ﻣﺨﺘﻠﻒ( .ﺍﻧﺪﺍﺯﻩ ﭘﻠﻪ ﺑﺮﺍﻱ ﺧﻄﺎﻱ ﭘﻴﺶ ﺑﻴﻨﻲ DCﻭ ﺩﻳﮕﺮ ﺿﺮﺍﻳﺐ ACﺩﺭ ﻳﻚ ﻣﺎﺗﺮﻳﺲ ﻧﺮﻣﺎﻟﻴﺰﺍﺳﻴﻮﻥ ﻣﺸﺨﺺ ﻣﻲ ﺷﻮﺩ. 8 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 ﻣﺎﺗﺮﻳﺲ ﺑﻪ ﺧﺼﻮﺹ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺗﻮﺍﻧﺪ ﺩﺭ ﺍﺑﺘﺪﺍﻱ ﺟﺮﻳﺎﻥ ﺑﻴﺖ ﻓﺸﺮﺩﻩ ﺷﺪﻩ ﺑﻪ ﻋﻨﻮﺍﻥ ﺍﻃﻼﻋﺎﺕ ﺟﺎﻧﺒﻲ ﺑﻴﺎﻳﺪ .ﺑﻪ ﻋﻨﻮﺍﻥ ﺟﺎﻳﮕﺰﻳﻦ ،ﻫﺮ ﻛﺲ ﻣﻲﺗﻮﺍﻧﺪ ﻣﺎﺗﺮﻳﺲ ﺗﻮﺻﻴﻪ ﺷﺪﻩ ﺗﻮﺳﻂ JPEGﺭﺍ ﻛﻪ ﺩﺭ ﺷﻜﻞ ١١ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ ﺑﻪ ﻃﻮﺭ ﭘﻴﺶ ﻓﺮﺽ ﺑﻪ ﻛﺎﺭ ﺑﺒﺮﺩ .ﻣﻌﻤﻮﻻﹰ ﻣﻲ ﺗﻮﺍﻥ ﺑﻴﻦ ﻛﻴﻔﻴﺖ ﻭ ﻧﺮﺥ ﺑﻴﺖ ﻣﺼﺎﻟﺤﻪ ﺑﺮ ﻗﺮﺍﺭ ﻛﺮﺩ )ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻓﺎﻛﺘﻮﺭ ﻣﻘﻴﺎﺱ( .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ،ﻳﻚ ﻓﺎﻛﺘﻮﺭ ﻣﻘﻴﺎﺱ ﺑﺮﺍﺑﺮ ٢ﺑﻪ ﺍﻳﻦ ﻣﻌﻨﺎﺳﺖ ﻛﻪ ﻃﻮﻝ ﭘﻠﻪ ﺑﺮﺍﻱ ﺗﻤﺎﻡ ﺿﺮﺍﻳﺐ ٢ﺑﺮﺍﺑﺮ ﺑﺸﻮﺩ .ﺍﺯ ﺳﻮﻱ ﺩﻳﮕﺮ ،ﻓﺎﻛﺘﻮﺭ ﻣﻘﻴﺎﺱ ٠/٥ﻛﻞ ﺍﻧﺪﺍﺯﻩ ﭘﻠﻪ ﻫﺎ ﺭﺍ ﻧﺼﻒ ﻣﻲﻛﻨﺪ .ﻓﺎﻛﺘﻮﺭ ﻣﻘﻴﺎﺱ ﻛﻮﭼﻜﺘﺮ ،ﻧﻤﺎﻳﺶ ﺩﻗﻴﻘﺘﺮﻱ ﺍﺯ ﺗﺼﻮﻳﺮ ﺍﺻﻠﻲ ﺭﺍ ﻧﺘﻴﺠﻪ ﻣﻲ ﺩﻫﺪ ﻭﻟﻲ ﺑﻬﺮﺓ ﻓﺸﺮﺩﻩﺳﺎﺯﻱ ﺭﺍ ﻛﻢ ﻣﻲﻛﻨﺪ. ﺑﺮﺍﻱ ﻛﺪ ﮔﺸﺎﻳﻲ ﺩﻭﺩﻭﻳﻲ ﺧﻄﺎﻱ ﭘﻴﺶ ﺑﻴﻨﻲ DCﻛﻮﺍﻧﺘﻴﺰﻩ ﺷﺪﻩ ﻭ ﺿﺮﺍﻳﺐ ،DCﺗﺮﻛﻴﺒﻲ ﺍﺯ ﻛﺪﻳﻨﮓ ﺑﺎ ﻃﻮﻝ ﻣﺘﻐﻴﺮ ﻭ ﻃﻮﻝ ﺛﺎﺑﺖ ﺑﻪ ﻛﺎﺭ ﻣﻲﺭﻭﺩ .ﺗﻤﺎﻡ ﻣﻘﺎﺩﻳﺮ ﺧﻄﺎﻱ ﭘﻴﺶ ﺑﻴﻨﻲ ﻣﻤﻜﻦ ﻭ ﺗﻤﺎﻡ ﻣﻘﺎﺩﻳﺮ ﺿﺮﺍﻳﺐ ACﺑﻌﺪ ﺍﺯ ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﺑﻪ ﺩﺳﺘﻪﻫﺎﻱ ﻣﺨﺘﻠﻒ )ﺑﺮ ﺍﺳﺎﺱ ﺍﻧﺪﺍﺯﻩﺷﺎﻥ( ﺗﻘﺴﻴﻢ ﻣﻲ ﺷﻮﻧﺪ .ﺟﺪﻭﻝ ٦-١٤ﺩﺭ ] [١ﺭﺍ ﺑﺮﺍﻱ ﻗﺎﻧﻮﻥ ﺩﺳﺘﻪ ﺑﻨﺪﻱ ﺑﺒﻴﻨﻴﺪ .ﺧﻄﺎﻱ ﭘﻴﺶ ﺑﻴﻨﻲ DCﺑﺎ ﻳﻚ ﻛﺪ ﺩﻭ ﻗﺴﻤﺘﻲ ﻛﺪ ﮔﺬﺍﺭﻱ ﻣﻲ ﺷﻮﺩ .ﻗﺴﻤﺖ ﺍﻭﻝ ﻣﺸﺨﺺ ﻣﻲ ﻛﻨﺪ ﻛﻪ ﺩﺭ ﻛﺪﺍﻡ ﺩﺳﺘﻪ ﺍﺳﺖ ﻭ ﻗﺴﻤﺖ ﺩﻭﻡ ﺍﻧﺪﺍﺯﻩ ﻧﺴﺒﻲ ﻭﺍﻗﻌﻲ ﺩﺭ ﺁﻥ ﺩﺳﺘﻪ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ. ﻗﺴﻤﺖ ﺍﻭﻝ ﺑﺮ ﺍﺳﺎﺱ ﻓﺮﻛﺎﻧﺲ ﻫﺎﻱ ﺩﺳﺘﻪ ﻫﺎﻱ ﻣﺨﺘﻠﻒ ﻛﺪ ﻫﺎﻓﻤﻦ ﻣﻲ ﺷﻮﺩ ﻭ ﺩﺭ ﺣﺎﻟﻲ ﻛﻪ ﻗﺴﻤﺖ ﺩﻭﻡ ﺑﺎ ﻳﻚ ﻛﻠﻤﻪ ﻛﺪ ﺑﺎ ﻃﻮﻝ ﺛﺎﺑﺖ ﻛﺪ ﻣﻲﺷﻮﺩ .ﺑﺮﺍﻱ ﺿﺮﺍﻳﺐ ،ACﻳﻚ ﺭﻭﺵ ﻛﺪﻳﻨﮓ RLCﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ .ﺩﺭ ﺍﻳﻦ ﺭﻭﺵ ،ﺍﺑﺘﺪﺍ ﺿﺮﺍﻳﺐ DCTﺑﻪ ﻳﻚ ﺁﺭﺍﻳﻪ ﻳﻚ ﺑﻌﺪﻱ ﺑﺮ ﺍﺳﺎﺱ ﺗﺮﺗﻴﺐ ﺯﻳﮕﺰﺍﮔﻲ ﻫﻤﺎﻥ ﻃﻮﺭ ﻛﻪ ﺩﺭ ﺷﻜﻞ ١٢ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ ﺗﺒﺪﻳﻞ ﻣﻲ ﺷﻮﻧﺪ. ﺷﮑﻞ :11ﯾﮏ ﻣﺎﺗﺮﯾﺲ ﻧﺮﻣﺎل ﺳﺎزي ﻣﻌﻤﻮل ﺷﮑﻞ :12ﯾﮏ ﻣﺎﺳﮏ زﯾﮕﺰاگ ﻣﻌﻤﻮل ﺿﺮﺍﻳﺐ ACﺑﻪ ﺳﻤﺒﻮﻝ ﻫﺎ ﺗﺒﺪﻳﻞ ﻣﻲ ﺷﻮﺩ ﻭ ﻫﺮ ﺳﻤﺒﻮﻝ ﻳﻚ ﺟﻔﺖ ﺗﺸﻜﻴﻞ ﻳﺎﻓﺘﻪ ﺍﺯ ﺍﻧﺪﺍﺯﺓ ﺻﻔﺮﻫﺎ ﺍﺯ ﺁﺧﺮﻳﻦ ﻣﻘﺪﺍﺭ ﻏﻴﺮ ﺻﻔﺮ ﺗﺎ ﻣﻘﺪﺍﺭ ﻏﻴﺮ ﺻﻔﺮ ﺑﻌﺪﻱ ﺍﺳﺖ .ﻣﻘﺪﺍﺭ ﻏﻴﺮ ﺻﻔﺮ ﺗﻮﺳﻂ ﺩﻭ ﻗﺴﻤﺖ ﻣﺸﺨﺺ ﻣﻲ ﺷﻮﺩ ،ﺷﺒﻴﻪ ﻛﺎﺭﻱ ﻛﻪ ﺑﺮﺍﻱ ﺧﻄﺎﻱ ﭘﻴﺶ ﺑﻴﻨﻲ DCﺍﻧﺠﺎﻡ ﺷﺪ. ﻗﺴﻤﺖ ﺍﻭﻝ ﻣﺸﺨﺺ ﻣﻲﻛﻨﺪ ﻛﻪ ﺑﻪ ﻛﺪﺍﻡ ﺩﺳﺘﻪ ﺗﻌﻠﻖ ﺩﺍﺭﺩ ﻭ ﻗﺴﻤﺖ ﺩﻭﻡ ﺍﻧﺪﺍﺯﻩ ﻧﺴﺒﻲ ﺭﺍ ﻣﺸﺨﺺ ﻣﻲﻛﻨﺪ .ﺳﻤﺒﻮﻝ ﺗﺸﻜﻴﻞ ﺷﺪﻩ ﺍﺯ RLC ﺻﻔﺮ ﻭ ﺩﺳﺘﻪ ﻣﻘﺪﺍﺭ ﻏﻴﺮ ﺻﻔﺮ ،ﻛﺪ ﻫﺎﻓﻤﻦ ﻣﻲ ﺷﻮﺩ ،ﺩﺭ ﺣﺎﻟﻲ ﻛﻪ ﺍﻧﺪﺍﺯﻩ ﻧﺴﺒﻲ ﻣﻘﺪﺍﺭ ﻏﻴﺮ ﺻﻔﺮ ﺑﺎ ﻛﺪ ﺑﺎ ﻃﻮﻝ ﺛﺎﺑﺖ ﻛﺪ ﻣﻲ ﺷﻮﺩ .ﺍﺳﺘﺎﻧﺪﺍﺭﺩ، ﺑﻌﻀﻲ ﺟﺪﺍﻭﻝ ﻫﺎﻓﻤﻦ ﭘﻴﺶ ﻓﺮﺽ ﺭﺍ ﺑﺮﺍﻱ ﺧﻄﺎﻱ ﭘﻴﺶﺑﻴﻨﻲ DCﻭ ﺳﻤﺒﻮﻝﻫﺎﻱ ACﺗﻮﺻﻴﻪ ﻣﻲ ﻛﻨﺪ .ﻭﻟﻲ ﻛﺎﺭﺑﺮ ﻣﻲﺗﻮﺍﻧﺪ ﺟﺪﺍﻭﻝ ﻣﺨﺘﻠﻔﻲ ﻛﻪ ﺑﺮﺍﻱ ﺧﺼﻮﺻﻴﺎﺕ ﺁﻣﺎﺭﻱ ﺗﺼﺎﻭﻳﺮ ﺩﺭ ﻳﻚ ﻛﺎﺭﺑﺮﺩ ﺧﺎﺹ ﺑﻬﻴﻨﻪ ﺷﺪﻩ ﺍﻧﺪ ﺭﺍ ﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﺪ .ﺑﺮﺍﻱ ﻳﻚ ﺗﺼﻮﻳﺮ ﺭﻧﮕﻲ ،ﻫﺮ ﻣﻮﻟﻔﺔ ﺭﻧﮓ ﺑﻪ ﻃﻮﺭ ﺟﺪﺍﮔﺎﻧﻪ ﺑﺎ ﻫﻤﻴﻦ ﺭﻭﺵ ﻓﺸﺮﺩﻩ ﻣﻲﺷﻮﺩ .ﺷﻜﻞ ١٣ﺗﺼﺎﻭﻳﺮ ﻓﺸﺮﺩﻩ ﺷﺪﻩ JPEGﺑﻪ ﺩﺳﺖ ﺁﻣﺪﻩ ﺑﺎ ﺍﻧﺘﺨﺎﺏ ﻓﺎﻛﺘﻮﺭﻫﺎﻱ ﻣﻘﻴﺎﺱ ﻣﺨﺘﻠﻒ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲ ﺩﻫﺪ. 9 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 ﺷﮑﻞ : 13ﺗﺼﺎوﯾﺮ ﻓﺸﺮده ﺷﺪه JPEGﺑﻪ دﺳﺖ آﻣﺪه ﺑﺎ اﻧﺘﺨﺎب ﻓﺎﮐﺘﻮرﻫﺎي ﻣﻘﯿﺎس ﻣﺨﺘﻠﻒ -4-2ﮐﻮاﻧﺘﯿﺰاﺳﯿﻮن ﺑﺮداري ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﺑﺮﺩﺍﺭﻱ ) (VQﺭﺍﻫﺒﺮﺩ ﺩﻳﮕﺮﻱ ﺑﺮﺍﻱ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﺗﺼﻮﻳﺮ ﺍﺳﺖ .ﺍﻳﺪﻩ ﭘﺸﺖ VQﺗﻌﻴﻴﻦ ﺑﻬﺘﺮﻳﻦ ﺩﺳﺘﻪ ﺍﺯ ﺍﻟﮕﻮﻫﺎﻱ ﺑﻠﻮﻙ ﭘﺎﻳﻪ )ﻛﻪ ﻫﺮ ﻛﺪﺍﻡ ﻳﻚ ﻛﻠﻤﻪ ﻛﺪ ﺧﻮﺍﻧﺪﻩ ﻣﻲ ﺷﻮﻧﺪ( ﺍﺳﺖ ﻛﻪ ﺑﻪ ﺑﻬﺘﺮﻳﻦ ﻭﺟﻪ ﺗﻤﺎﻡ ﺑﻠﻮﻙ ﻫﺎﻱ ﺗﺼﺎﻭﻳﺮ ﺭﺍ ﺩﺭ ﻳﻚ ﺗﺼﻮﻳﺮ ﻧﻤﺎﻳﺶ ﺩﻫﺪ. ﻣﺠﻤﻮﻋﻪ ﺗﻤﺎﻡ ﺍﻟﮕﻮﻫﺎﻱ ﭘﺎﻳﻪ ،ﻛﺘﺎﺏ – ﻛﺪ ﺧﻮﺍﻧﺪﻩ ﻣﻲ ﺷﻮﺩ .ﻣﻌﻤﻮﻻﹰ ﺑﻬﺘﺮﻳﻦ ﻛﺘﺎﺏ – ﻛﺪ ﺑﺮﺍﻱ ﻳﻚ ﻛﻼﺱ ﺍﺯ ﺗﺼﺎﻭﻳﺮ ،ﺍﺯ ﻗﺒﻞ ﻃﺮﺍﺣﻲ ﻣﻲ ﺷﻮﺩ .ﺩﺭ ﻓﺮﺍﻳﻨﺪ ﻛﺪﮔﺬﺍﺭﻱ ﺑﺮﺍﻱ ﻫﺮ ﺑﻠﻮﻙ ﺗﺼﻮﻳﺮ ﺩﺍﺩﻩ ﺷﺪﻩ ﺑﻬﺘﺮﻳﻦ ﻛﻠﻤﻪ – ﻛﺪ ﻣﻨﻄﺒﻖ ﺩﺭ ﻛﺘﺎﺏ -ﻛﺪ ﭘﻴﺪﺍ ﻣﻲ ﺷﻮﺩ .ﺍﮔﺮ ﭼﻪ ﺍﻳﻦ ﺭﻭﺵ ﺟﺴﺘﺠﻮ ﻣﺤﺎﺳﺒﺎﺕ ﺑﻴﺸﺘﺮﻱ ﺭﺍ ﻧﺴﺒﺖ ﺑﻪ JPEGﻃﻠﺐ ﻣﻲﻛﻨﺪ ،ﺩﺭ ﻛﺪﮔﺸﺎﻳﻲ ﺑﺴﻴﺎﺭ ﺳﺮﻳﻌﺘﺮ ﻭ ﺳﺎﺩﻩﺗﺮ ﺍﺳﺖ .ﻛﺪﮔﺸﺎﻳﻲ ﺍﻃﻼﻋﺎﺕ ﻛﺪﮔﺬﺍﺭﻱ ﺷﺪﻩ ﺑﺎ ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﺑﺮﺩﺍﺭﻱ ﺷﺎﻣﻞ ﭘﻴﺪﺍ ﻛﺮﺩﻥ ﻛﻠﻤﻪ – ﻛﺪ ﻣﻨﺎﺳﺐ ﺩﺭ ﻛﺘﺎﺏ – ﻛﺪ – ﺑﺮ ﺍﺳﺎﺱ ﺍﻧﺪﻳﺲ ﺍﻳﺠﺎﺩ ﺷﺪﻩ ﺩﺭ ﺧﻼﻝ ﭘﺮﺩﺍﺯﺵ ﻛﺪﮔﺬﺍﺭﻱ ﺍﺳﺖ .ﭘﻴﭽﻴﺪﮔﻲ ،VQﺑﻪ ﻃﻮﺭ ﻧﻤﺎﻳﻲ ﺑﺎ ﺍﻧﺪﺍﺯﻩ ﺑﻠﻮﻙ )ﺗﻌﺪﺍﺩ ﭘﻴﻜﺴﻞﻫﺎﻱ ﻫﺮ ﺑﻠﻮﻙ( ﺍﻓﺰﺍﻳﺶ ﻣﻲ ﻳﺎﺑﺪ .ﺩﺭ ﻋﻤﻞ ﺍﻧﺪﺍﺯﻩ ﺑﻠﻮﻙ ﻣﺴﺎﻭﻱ ﻳﺎ ﻛﻮﭼﻜﺘﺮ ﺍﺯ ٤*٤ﺍﺳﺖ ﻛﻪ ﺍﻏﻠﺐ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﺷﻜﻞ ،١٤ﻣﻌﻤﺎﺭﻱ ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﺑﺮﺩﺍﺭﻱ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ. ﺷﮑﻞ :14ﮐﻮاﻧﺘﯿﺰاﺳﯿﻮن ﺑﺮداري ﺳﺎﺩﻩﺗﺮﻳﻦ ﺭﺍﻫﺒﺮﺩ ﺑﺮﺍﻱ ﭘﺮﺩﺍﺯﺵ ﺑﺨﺶﻫﺎﻱ ﺗﺼﻮﻳﺮ ،ﺗﻘﺴﻴﻢ ﺗﺼﻮﻳﺮ ﻭﺭﻭﺩﻱ ﺩﺭ ﻛﺪﮔﺬﺍﺭ ﺑﻪ ﺑﻠﻮﻙﻫﺎﻱ ﻳﺎ ﺑﺮﺩﺍﺭﻫﺎﻱ ﻣﺴﺘﻄﻴﻠﻲ ،ﻏﻴﺮ ﻫﻤﭙﻮﺷﺎﻧﻲ ،ﭼﺴﺒﻴﺪﻩ ﻭ ﻛﻮﭼﻚ ﺍﺯ ﭘﻴﻜﺴﻞﻫﺎ ﺍﺳﺖ ﻛﻪ ﻫﺮ ﻛﺪﺍﻡ ﺟﺪﺍﮔﺎﻧﻪ ﻛﻮﺍﻧﺘﻴﺰﻩ ﺷﻮﺩ .ﺍﺑﻌﺎﺩ ﺑﺮﺩﺍﺭ ﻣﺴﺎﻭﻱ ﺗﻌﺪﺍﺩ ﭘﻴﻜﺴﻞ ﻫﺎﻱ ﻫﺮ ﺑﻠﻮﻙ 10 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 ﺍﺳﺖ .ﺑﺮﺩﺍﺭ ﻧﻤﻮﻧﻪ ﻫﺎ ،ﺍﻟﮕﻮﻳﻲ ﺍﺳﺖ ﻛﻪ ﺑﺎﻳﺪ ﺑﺎ ﻣﺠﻤﻮﻋﻪ ﺍﻟﮕﻮﻫﺎﻱ ﺗﺴﺖ ﺗﻘﺮﻳﺐ ﺯﺩﻩ ﺷﻮﺩ .ﺍﻟﮕﻮﻫﺎ ﺩﺭ ﻳﻚ ﺩﻳﻜﺸﻨﺮﻱ ﺫﺧﻴﺮﻩ ﻣﻲﺷﻮﻧﺪ. ﺍﻟﮕﻮﻫﺎﻱ ﻣﻮﺟﻮﺩ ﺩﺭ ﻛﺘﺎﺏ – ﻛﺪ ،ﻛﻠﻤﻪ – ﻛﺪ ﺧﻮﺍﻧﺪﻩ ﻣﻲ ﺷﻮﻧﺪ. ﺩﺭ ﺧﻼﻝ ﻓﺸﺮﺩﻩﺳﺎﺯﻱ ،ﻛﺪﮔﺬﺍﺭ ،ﺑﻪ ﻫﺮ ﺩﻭ ﺑﺮﺩﺍﺭ ﻭﺭﻭﺩﻱ ﻳﻚ ﺁﺩﺭﺱ ﻳﺎ ﺍﻧﺪﻳﺲ ﻣﻲ ﺩﻫﺪ ﻛﻪ ﻛﻠﻤﻪ – ﻛﺪﻱ ﺭﺍ ﻛﻪ ﺩﺭ ﻛﺘﺎﺏ – ﻛﺪ ﺑﻪ ﺑﻬﺘﺮﻳﻦ ﻭﺟﻪ ﺑﺮﺩﺍﺭ ﻭﺭﻭﺩﻱ ﺭﺍ ﺗﻘﺮﻳﺐ ﻣﻲﺯﻧﺪ ﻣﺸﺨﺺ ﻣﻲﻛﻨﺪ .ﺩﺭ ﻛﺪﮔﺬﺍﺭ ﻫﺮ ﺍﻧﺪﻳﺲ ﺑﻪ ﻳﻚ ﺑﺮﺩﺍﺭ ﺧﺮﻭﺟﻲ ﮔﺮﻓﺘﻪ ﺷﺪﻩ ﺍﺯ ﻛﺘﺎﺏ – ﻛﺪ ﻣﺘﻨﺎﻇﺮ ﻣﻲﺷﻮﺩ .ﻛﺪﮔﺸﺎ ﺗﺼﻮﻳﺮ ﺭﺍ ﺑﺎ ﻫﻤﺎﻥ ﺗﺮﺗﻴﺐ ﺑﺮﺩﺍﺭﻫﺎﻱ ﻭﺭﻭﺩﻱ ﺑﺎﺯﺳﺎﺯﻱ ﻣﻲﻛﻨﺪ .ﻭﻳﺮﺍﻳﺶ ﺳﻮﻡ Indeoﺍﺯ ﺷﺮﮐﺖ ،Intelﺑﺮ ﺍﺳﺎﺱ ﺭﻭﺵ ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﺑﺮﺩﺍﺭﻱ ﻛﺎﺭ ﻣﻲ ﻛﻨﺪ. -3آزﻣﺎﯾﺶ -١ﺍﺯ ﻳﻚ ﺗﺼﻮﻳﺮ bmpﺑﻪ ﻋﻨﻮﺍﻥ ﺗﺼﻮﻳﺮ ﻭﺭﻭﺩﻱ ﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻴﺪ ﻭ ﻛﺪﻳﻨﮓ RLCﺩﻭ ﺳﻄﺤﻲ ﺭﺍ ﺑﻪ ﻃﻮﺭ ﺩﺳﺘﻲ ﺍﻧﺠﺎﻡ ﺩﻫﻴﺪ ﻭ ﺍﺣﺘﻤﺎﻝ ﻃﻮﻝ ﻫﺎﻱ ﻣﺨﺘﻠﻒ ﺭﺍ ﺣﺴﺎﺏ ﻛﻨﻴﺪ .ﺳﭙﺲ ﻛﺪﻳﻨﮓ ﻫﺎﻓﻤﻦ ﺭﺍ ﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻴﺪ )ﺑﻪ ﺷﻜﻞ ٣ﻣﺮﺍﺟﻌﻪ ﻛﻨﻴﺪ( ﺗﺎ ﻛﻠﻤﻪ ﻛﺪ ﻫﺮ ﺳﻤﺒﻮﻝ ﺭﺍ ﺑﻪ ﺩﺳﺖ ﺁﻭﺭﻳﺪ .ﺳﭙﺲ ﻃﻮﻝ ﻣﻴﺎﻧﮕﻴﻦ ﻛﺪ ﺭﺍ ﻣﺤﺎﺳﺒﻪ ﻛﻨﻴﺪ .ﻣﻲﺗﻮﺍﻧﻴﺪ ﺍﺯ ﺩﺳﺘﻮﺭ )( bmpreadﺑﺮﺍﻱ ﺧﻮﺍﻧﺪﻥ ﻭ ﻧﻤﺎﻳﺶ ﻓﺎﻳﻞ ﻭﺭﻭﺩﻱ ﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻴﺪ. -٢ﺑﺎ dctdemo.mﺑﺎﺯﻱ ﻛﻨﻴﺪ .ﺑﻪ ﺗﺄﺛﻴﺮ ﺍﻧﺘﺨﺎﺏ ﺗﻌﺪﺍﺩ ﻣﺨﺘﻠﻒ ﺿﺮﺍﻳﺐ DCTﺗﻮﺟﻪ ﻛﻨﻴﺪ .ﺑﺮﺍﻱ ﻳﻚ ﺗﺼﻮﻳﺮ ﺍﻧﺘﺨﺎﺏ ﺷﺪﻩ ،ﺣﺪﺍﻗﻞ ﺗﻌﺪﺍﺩ ﺿﺮﺍﻳﺒﻲ ﻛﻪ ﺑﺎﻳﺪ ﺍﻧﺘﺨﺎﺏ ﻛﻨﻴﺪ ﺗﺎ ﻧﺘﻴﺠﻪ ﺭﺿﺎﻳﺖ ﺑﺨﺶ ﺑﮕﻴﺮﻳﺪ ﭼﻴﺴﺖ؟ ﺑﺮﺍﻱ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﺑﻪ ﺗﺼﻮﻳﺮ ﺧﻄﺎ ﻧﻴﺰ ﺗﻮﺟﻪ ﻛﻨﻴﺪ. -٣ﭘﻴﻮﺳﺖ ﺍﻟﻒ ﺑﺮﻧﺎﻣﺔ dctquantﺭﺍ ﻣﻲ ﺩﻫﺪ ﻛﻪ DCTﺭﺍ ﺑﺮ ﺭﻭﻱ ﺑﻠﻮﻙ ٨*٨ﺣﺴﺎﺏ ﻣﻲ ﻛﻨﺪ ﻭ ﺳﭙﺲ ﺿﺮﺍﻳﺐ DCTﺭﺍ ﻛﻮﺍﻧﺘﻴﺰﻩ ﻣﻲ ﻛﻨﺪ .ﺳﭙﺲ ﻋﻜﺲ DCTﺭﺍ ﺍﻧﺠﺎﻡ ﻣﻲ ﺩﻫﺪ ﺗﺎ ﺗﺼﻮﻳﺮ ﺑﺎﺯﺳﺎﺯﻱ ﺷﺪﻩ ﺭﺍ ﺑﻪ ﺩﺳﺖ ﺁﻭﺭﺩ .ﺑﺎ ﺑﺮﻧﺎﻣﻪ ﺑﺎﺯﻱ ﻛﻨﻴﺪ ﺗﺎ ﺗﺄﺛﻴﺮ ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﺭﺍ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻓﺎﻛﺘﻮﺭﻫﺎﻱ ﻣﻘﻴﺎﺱ ﻣﺨﺘﻠﻒ ﺑﻪ ﺩﺳﺖ ﺁﻭﺭﻳﺪ .ﺑﺮﺍﻱ ﻓﻬﻤﻴﺪﻥ ﺍﻳﻦ ﺑﺮﻧﺎﻣﻪ ﺷﻤﺎ ﺑﺎﻳﺪ ﺗﻮﺍﺑﻊ ” “blkprocﻭ ” “mask2.mﺭﺍ ﻳﺎﺩ ﺑﮕﻴﺮﻳﺪ. dctquant.m -٤ﺭﺍ ﺍﺻﻼﺡ ﻛﻨﻴﺪ ﻭ ﺑﻪ ﺟﺎﻱ ﻛﻮﺍﻧﺘﻴﺰﻩ ﻛﺮﺩﻥ ﺿﺮﺍﻳﺐ DCTﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻣﺎﺗﺮﻳﺲ ﻧﺮﻣﺎﻟﻴﺰﺍﺳﻴﻮﻥ ﻓﺮﺍﻫﻢ ﺷﺪﻩ ﺗﻨﻬﺎ L ﺿﺮﻳﺐ ﺍﻭﻝ ﺭﺍ ﺩﺭ ﻳﻚ ﺗﺮﺗﻴﺐ ﺯﻳﮓ ﺯﺍﮒ ﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻴﺪ .ﻣﻘﺎﺩﻳﺮ ﻣﺨﺘﻠﻒ Lﺑﻴﻦ ١ﺗﺎ ١٦ﺭﺍ ﺍﻣﺘﺤﺎﻥ ﻛﻨﻴﺪ. ﺗﻮﺟﻪ :ﺷﻤﺎ ﺑﺎﻳﺪ ﻣﺎﺳﻚ ﺭﺍ ﺩﺭ ﺑﺮﻧﺎﻣﻪ ﻃﻮﺭﻱ ﺍﺻﻼﺡ ﻛﻨﻴﺪ ﻛﻪ ﺑﺘﻮﺍﻧﺪ ﺗﺸﺨﻴﺺ ﺩﻫﺪ ﻛﻪ ﻛﺪﺍﻡ ﺿﺮﺍﻳﺐ ﺑﺎﻳﺪ ﺣﻔﻆ ﺷﻮﻧﺪ ﻭ ﻛﺪﺍﻡ ﺿﺮﺍﻳﺐ ﺑﺎﻳﺪ ﺻﻔﺮ ﺷﻮﻧﺪ .ﻳﺎ ﺍﻳﻨﻜﻪ ﻣﻲ ﺗﻮﺍﻧﻴﺪ ﻳﻚ ﺑﺮﻧﺎﻣﻪ ” “maskﺟﺪﻳﺪ ﺑﺮﺍﻱ ﺍﻳﻦ ﻛﺎﺭ ﺑﻨﻮﻳﺴﻴﺪ. -٥ﺑﺮﻧﺎﻣﻪ dctquant.mﺭﺍ ﺍﺻﻼﺡ ﻛﻨﻴﺪ ﻃﻮﺭﻱ ﻛﻪ ﺑﻪ ﺟﺎﻱ ﻛﻮﺍﻧﺘﻴﺰﻩ ﻛﺮﺩﻥ ﺿﺮﺍﻳﺐ DCTﺑﺮ ﺍﺳﺎﺱ ﻣﺎﺗﺮﻳﺲ ﻧﺮﻣﺎﻟﻴﺰﺍﺳﻴﻮﻥ ،ﺗﻨﻬﺎ ﺿﺮﺍﻳﺒﻲ ﺭﺍ ﻧﮕﻪ ﺩﺍﺭﺩ ﻛﻪ ﺍﻧﺪﺍﺯﻩ ﺍﻱ ﺑﺰﺭﮔﺘﺮ ﺍﺯ ﺁﺳﺘﺎﻧﻪ Tﺩﺍﺷﺘﻪ ﺑﺎﺷﻨﺪ .ﻣﻘﺎﺩﻳﺮ ﻣﺨﺘﻠﻒ Tﺑﻴﻦ ١ﺗﺎ ٢٥٦ﺭﺍ ﺍﻣﺘﺤﺎﻥ ﻛﻨﻴﺪ .ﻧﺘﻴﺠﻪﻱ ﺣﺎﺻﻞ ﺍﺯ ﺍﻳﻦ ﺁﺯﻣﺎﻳﺶ ﺭﺍ ﺑﺎ ﻧﺘﻴﺠﻪ ﺁﺯﻣﺎﻳﺶ ﺷﻤﺎﺭﻩ ٤ﻣﻘﺎﻳﺴﻪ ﻛﻨﻴﺪ. -4ﮔﺰارش -١ﺩﻳﺎﮔﺮﺍﻡ ﻳﻚ ﺍﻟﮕﻮﺭﻳﺘﻢ ﻧﻤﻮﻧﻪ ﻛﺪﻳﻨﮓ ﺗﺼﻮﻳﺮ ﺭﺍ ﺑﻜﺸﻴﺪ )ﺑﻪ ﺷﻜﻞ ١ﻣﺮﺍﺟﻌﻪ ﻛﻨﻴﺪ( ﻭ ﺗﻮﺿﻴﺢ ﺩﻫﻴﺪ ﻛﺪﺍﻡ ﻗﺴﻤﺖ ﻫﺎ ﺑﺎ ﺗﻠﻔﺎﺕ ﻭ ﻛﺪﺍﻡ ﺑﺪﻭﻥ ﺗﻠﻔﺎﺕ ﻫﺴﺘﻨﺪ. -٢ﺑﺮﻧﺎﻣﻪ ﻫﺎﻳﻲ ﻛﻪ ﻧﻮﺷﺘﻪ ﺍﻳﺪ ﺗﺤﻮﻳﻞ ﺑﺪﻫﻴﺪ .ﻫﻢ ﻛﺪ ﺑﺮﻧﺎﻣﻪ ﻫﻢ ﺧﺮﻭﺟﻲ ﺁﻥ. -٣ﺑﺮﺍﻱ ﺁﺯﻣﺎﻳﺶ ﻫﺎﻱ ٢،٣،٤ﺍﺛﺮ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﻣﺨﺘﻠﻒ ﻛﻮﺍﻧﺘﻴﺰﺍﺳﻴﻮﻥ ﺭﺍ ﺗﻮﺿﻴﺢ ﺩﻫﻴﺪ ،ﺗﻌﺪﺍﺩ ﺿﺮﺍﻳﺐ ﺑﺎﻗﻴﻤﺎﻧﺪﻩ ﻭ ﺁﺳﺘﺎﻧﻪ ﺭﺍ ﺑﻨﻮﻳﺴﻴﺪ. ﺣﺪﺍﻛﺜﺮ ﻓﺎﻛﺘﻮﺭ ﻣﻘﻴﺎﺱ ،ﺣﺪﺍﻗﻞ ﺗﻌﺪﺍﺩ ﺿﺮﺍﻳﺐ ،ﺣﺪﺍﻛﺜﺮ ﺁﺳﺘﺎﻧﻪ ﺭﺍ ﺑﻪ ﻃﻮﺭﻱ ﻛﻪ ﻛﻴﻔﻴﺖ ﺗﺼﻮﻳﺮ ﺭﺍ ﺩﺭ ﺣﺪ ﺭﺿﺎﻳﺖ ﺑﺨﺶ ﺣﻔﻆ ﻛﻨﻴﻢ ﺑﻨﻮﻳﺴﻴﺪ. -٤ﺑﺮﺍﻱ ﻳﻚ ﺩﻧﺒﺎﻟﻪ ﻭﻳﺪﻳﻮ ،ﺍﻧﺪﺍﺯﻩ ﺗﺼﻮﻳﺮ ﺩﺭ ﻫﺮ ﻗﺎﺏ ٣٦٠*٢٤٠ﻭ ﻧﺮﺥ ﻗﺎﺑﻞ ٣٠ﻗﺎﺏ ﺑﺮ ﺛﺎﻧﻴﻪ ﺑﺎ ﺭﻧﮓ ﻛﺎﻣﻞ ) ٣ﺑﺎﻳﺖ ﺑﺮ ﭘﻴﻜﺴﻞ( ﺩﺍﺭﺩ. ﻧﺴﺒﺖ ﻓﺸﺮﺩﻩ ﺳﺎﺯﻱ ﺑﺮﺍﻱ ﺑﻪ ﺩﺳﺖ ﺁﻭﺭﺩﻥ ﺩﻧﺒﺎﻟﻪ ١/٥ mbits/secondﭼﻴﺴﺖ؟ -5ﻣﺮاﺟﻊ [1]. R. C. Gonzalez & R. E. Woods, “Digital Image Processing”, Addison Wesley, 1992. 11 CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 [2]. A. N. Netravali and B. G. Haskell, “Digital Pictures, Representation, Compression, and Standards”, 2nd ed., Plenum Press, 1995. ﭘﯿﻮﺳﺖ اﻟﻒ ****************************************************************** * MATLAB Script file for demonstration of DCT representation of images * * You should find out how to use “blkproc” by on-line help in matlab. ****************************************************************** function dctquant(FileName,dx,dy); % usage : dctquant('h:\el593\exp10\lena.img',256,256); (WYT: please verify) % Note, dctquant calls subfunctions mask2() Img=fread(fopen(FileName),[dx,dy]); colormap(gray(256)); image(Img'); set(gca,'XTick',[],'YTick',[]); title('Original Image'); truesize; drawnow y=blkproc(Img,[8 8],'dct2'); yy=blkproc(y,[8 8],'mask2'); yq=blkproc(yy,[8,8],'idct2'); figure; colormap(gray(256)); image(yq'); set(gca,'XTick',[],'YTick',[]); title('Quantized Image'); truesize; drawnow; CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 12 ﭘﯿﻮﺳﺖ ب ****************************************************************** * MATLAB Script file for demonstration of DCT (subroutine 1) * ****************************************************************** function [y]=mask2(x); mask=[16 11 10 16 24 40 51 61; 12 12 14 19 26 58 60 55; 14 13 16 24 40 57 69 56; 14 17 22 29 51 87 80 62; 18 22 37 56 68 109 103 77; 24 35 55 64 81 104 113 92; 49 64 78 87 103 121 120 101; 72 92 95 56 112 100 103 99]; % Normally c=1 c=16; mask=c*mask; z=round(x./mask); y=mask.*z; CE 342 – Multimedia HW# 5 H. Rabiee, Spring 2008 13
© Copyright 2025 Paperzz