SlideShare una empresa de Scribd logo
1 de 19
Descargar para leer sin conexión
ハフマン符号
http://www.computerhope.com/people/david_huffman.htm
13年6月13日木曜日
ハフマン符号って?
•データを圧縮するときの符号化法
•JPEGやZIPで利用されている
David Huffmanさんが作りました
13年6月13日木曜日
アルゴリズム
• 1. データ列のアルファベットを出現回数順
に、昇順に並び替える
• 2. 小さい順にアルファベットを融合していく
• 3. 各アルファベットにビット列を割り振っ
て、元のデータ列を変換する
13年6月13日木曜日
やってみよう
「TONGULLMAN」というデータ列を
圧縮してみます
13年6月13日木曜日
1. データ列のアルファベットを
出現回数順に、昇順に並び替える
•TONGULLMAN
•↓
•T(1), O(1), G(1), U(1), M(1), A(1),
N(2), L(2)
13年6月13日木曜日
2. 小さい順にアルファベットを
融合していく
•T(1), O(1), G(1), U(1), M(1), A(1),
N(2), L(2)
•↓
•G(1), U(1), M(1), A(1), TO(2), N(2),
L(2)
•融合できなくなるまで繰り返す
13年6月13日木曜日
木構造で表すと
T (1) O(1) G(1) U(1) M(1) A(1) N(2) L(2)
13年6月13日木曜日
木構造で表すと
T (1) O(1) G(1) U(1) M(1) A(1) N(2) L(2)
TO(2)
13年6月13日木曜日
木構造で表すと
T (1) O(1) G(1) U(1) M(1) A(1) N(2) L(2)
TO(2) GU(2)
13年6月13日木曜日
木構造で表すと
T (1) O(1) G(1) U(1) M(1) A(1) N(2) L(2)
TO(2) GU(2) MA(2)
13年6月13日木曜日
木構造で表すと
T (1) O(1) G(1) U(1) M(1) A(1) N(2) L(2)
TO(2) GU(2) MA(2)
TOGU(4)
13年6月13日木曜日
木構造で表すと
T (1) O(1) G(1) U(1) M(1) A(1) N(2) L(2)
TO(2) GU(2) MA(2)
TOGU(4) MAN(4)
13年6月13日木曜日
木構造で表すと
T (1) O(1) G(1) U(1) M(1) A(1) N(2) L(2)
TO(2) GU(2) MA(2)
TOGU(4) MAN(4)
LMAN(6)
13年6月13日木曜日
木構造で表すと
T (1) O(1) G(1) U(1) M(1) A(1) N(2) L(2)
TO(2) GU(2) MA(2)
TOGU(4) MAN(4)
LMAN(6)
TOGULMAN(10)
13年6月13日木曜日
木構造で表すと
T (1) O(1) G(1) U(1) M(1) A(1) N(2) L(2)
TO(2) GU(2) MA(2)
TOGU(4) MAN(4)
LMAN(6)
TOGULMAN(10)
木構造の根から順に0, 1を割り振っていく
13年6月13日木曜日
木構造で表すと
T (1) O(1) G(1) U(1) M(1) A(1) N(2) L(2)
TO(2) GU(2) MA(2)
TOGU(4) MAN(4)
LMAN(6)
TOGULMAN(10)
木構造の根から順に0, 1を割り振っていく
0 1
0 1
0 1 0 1
0 1
0 1
0 1
13年6月13日木曜日
各文字に割り当てられた符号は
T
O
G
U
M
A
N
L
000
001
010
011
1000
1001
101
11
13年6月13日木曜日
3. 各アルファベットにビット列を割り振って、元
のデータ列を変換する
T
O
G
U
M
A
N
L
000
TONGULLMAN
↓
000001101010011111110001001101
001
010
011
1000
1001
101
11
13年6月13日木曜日
符号化おわり
•TONGULLMAN (10byte = 80bit)
•↓
• 000001101010011111110001001101 (30bit)
13年6月13日木曜日

Más contenido relacionado

Destacado

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 

Destacado (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

ハフマン符号