AV1

Mishaal Rahman นักแกะข้อมูลสาย Android ชื่อดัง รายงานว่ากูเกิลเตรียมใช้ไลบรารีถอดรหัสวิดีโอ AV1 ตัวใหม่ที่มีประสิทธิภาพมากขึ้น ช่วยให้มือถือรุ่นเก่าๆ ที่ไม่มีชิปถอดรหัส AV1 ในตัวสามารถดูวิดีโอ AV1 ด้วยซีพียู แต่ประหยัดแบตเตอรี่กว่าเดิม

เดิมทีนั้น Android ใช้ไลบรารี libgav1 ของกูเกิลเองมาตั้งแต่ Android 10 แต่ไลบรารีถอดรหัสวิดีโอที่นิยมใช้กันในวงการคือ libdav1d ของ VideoLAN ซึ่งมีข้อดีกว่าตรงที่บางส่วนเขียนด้วยภาษาแอสเซมบลี ทำงานกับชิป ARMv8 โดยตรง ช่วยลด overhead ของซีพียูลงได้มาก เหมาะกับการถอดรหัส AV1 บนฮาร์ดแวร์รุ่นเก่าๆ

จากการทดลองของ Rahman เองบนมือถือ Pixel 3 XL รุ่นเก่า การเล่นวิดีโอด้วย libgav1 ได้เฟรมเรตเพียง 10 fps ในขณะที่ libdav1d ได้เฟรมเรตเพิ่มมาเป็น 25-50 fps

สายข่าวของ Rahman บอกว่ากูเกิลตั้งเป้าเปลี่ยนไลบรารี AV1 ผ่าน Google Play System Update (Project Mainline อัพเดตบางส่วนของ OS ได้) ในเดือนมีนาคม 2024 แต่ตอนนี้ยังไม่ชัดว่าต้องเป็น Android เวอร์ชันใดบ้างที่จะได้ไลบรารีตัวใหม่นี้

ที่มา - Android Authority

Hiring! บริษัทที่น่าสนใจ

Carmen Software company cover
Carmen Software
Hotel Financial Solutions
Next Innovation (Thailand) Co., Ltd. company cover
Next Innovation (Thailand) Co., Ltd.
We are web design with consulting & engineering services driven the future stronger and flexibility.
KKP Dime company cover
KKP Dime
KKP Dime บริษัทในเครือเกียรตินาคินภัทร
Kiatnakin Phatra Financial Group company cover
Kiatnakin Phatra Financial Group
Financial Service
Fastwork Technologies company cover
Fastwork Technologies
Fastwork.co เว็บไซต์ที่รวบรวม ฟรีแลนซ์ มืออาชีพจากหลากหลายสายงานไว้ในที่เดียวกัน
Thoughtworks Thailand company cover
Thoughtworks Thailand
Thoughtworks เป็นบริษัทที่ปรึกษาด้านเทคโนโยลีระดับโลกที่คว้า Great Place to Work 3 ปีซ้อน
Iron Software company cover
Iron Software
Iron Software is an American company providing a suite of .NET libraries by engineer for engineers.
CLEVERSE company cover
CLEVERSE
Cleverse is a Venture Builder. Our team builds several tech companies.
Nipa Cloud company cover
Nipa Cloud
#1 OpenStack cloud provider in Thailand with our own data center and software platform.
Bangmod Enterprise company cover
Bangmod Enterprise
The leader in Cloud Server and Hosting in Thailand.
CIMB THAI Bank company cover
CIMB THAI Bank
MOVING FORWARD WITH YOU - CIMB is the leading ASEAN Bank
Bangkok Bank company cover
Bangkok Bank
Bangkok Bank is one of Southeast Asia's largest regional banks, a market leader in business banking
MuvMi (Urban Mobility Tech Co.,Ltd.) company cover
MuvMi (Urban Mobility Tech Co.,Ltd.)
Shape the future of urban mobility towards affordable, clean, and safe solutions
T.N. Digital Solution Co., Ltd. company cover
T.N. Digital Solution Co., Ltd.
TNDS has been involving in every first move of banking’s major digital transformation.
KBTG - KASIKORN Business-Technology Group company cover
KBTG - KASIKORN Business-Technology Group
KBTG - "The Technology Company for Digital Business Innovation"
Siam Commercial Bank Public Company Limited company cover
Siam Commercial Bank Public Company Limited
"Let's start a brighter career future together"
Icon Framework co.,Ltd. company cover
Icon Framework co.,Ltd.
Global Standard Platform for Real Estate แพลตฟอร์มสำหรับธุรกิจอสังหาริมทรัพย์ครบวงจร มาตรฐานระดับโลก
REFINITIV company cover
REFINITIV
The Financial and Risk business of Thomson Reuters is now Refinitiv
H LAB company cover
H LAB
Re-engineering healthcare systems through intelligent platforms and system design.
The Gang Technology Co., Ltd. company cover
The Gang Technology Co., Ltd.
We're a Digital Agency that helps our customers transform their business into digital with ease.
LTMH company cover
LTMH
LTMH มุ่งเน้นการพัฒนาผลิตภัณฑ์ที่สามารถช่วยพันธมิตรของเราให้บรรลุเป้าหมาย
Seven Peaks company cover
Seven Peaks
We Drive Digital Transformation
Wisesight (Thailand) Co., Ltd. company cover
Wisesight (Thailand) Co., Ltd.
The Best Choice For Handling Social Media · High Expertise in Social Data · Most Advanced and Secure
MOLOG Tech company cover
MOLOG Tech
We are Modern Logistic Platform, Specialize in WMS, OMS and TMS.
Data Wow Co.,Ltd company cover
Data Wow Co.,Ltd
We enable our clients to realize increased productivity by solving their most complex issues by Data
LINE Company Thailand company cover
LINE Company Thailand
LINE, the world's hottest mobile messaging platform, offers free text and voice messaging + Call
LINE MAN Wongnai company cover
LINE MAN Wongnai
Join our journey to becoming No.1 food platform in Thailand

overhead มันคือการใช้ resource มาก (อาจจะถึงมากกว่าที่ควร) ครับ

ส่วนคำที่เกี่ยวข้องก็คือ headroom ก็คือการมี resource มากเผื่อ overhead

นึกถึงเวลาอยู่บนเครื่องบินก็ได้ครับ overhead คือสิ่งที่อยู่เหนือหัว ส่วน headroom คือพื้นที่ที่อยู่เหนือหัว อะไรงี้ครับ

https://godbolt.org/

เขาเปิด assembly ดูได้เลยครับ (แล้วก็เปิดดุกันจริง ๆ นะ) ดังนั้นก็ไม่ต้องมานั่งมโนว่า compiler มันช่วย opimize ได้แล้วออกมาดีจริง ๆ หรือเปล่า

Optimization ของ compiler มันไม่ได้ฝากความหวังได้ขนาดนั้นครับ
ยังไม่รวมเรื่องหลายๆงาน มีข้อห้ามเรื่องการใช้ compiler optimization (พวกที่ใช้ในรถยนต์ รถไฟเครื่องบิน และอื่นๆที่มี safety standard กำกับอยู่)

อันนี้ประสบการณ์ตรงๆของผมเอง ...เคยมีคนจ้างให้ optimize matrix functions
ต้นฉบับเขียนมาด้วยภาษา C ปัญหาคือพอเอาไปใช้งานบน MCU บางตัวมันเร็วไม่พอ ต่อให้เปิด optimization สุดแล้วก็ยังไม่พอ
แต่พอเอามาเขียนเป็น assembly หลักๆที่ผมทำก็คือใช้ pipelineให้เต็มที่.... ลดเวลาลงไปได้เยอะอยู่ครับ

แต่ในอีกมุมนึง ถ้าเขียน assembly ล้วนแต่อยากให้ทำงานช้าก็ได้นะครับ

พอมี case ที่มันใช้องค์ประกอบ/อุปกรณ์น้อยๆ ให้ลองสักหน่อยไหมครับ มันยังคาใจ

เท่าที่รู้คือ เวลาเรา coding เพื่อให้ compiler มัน optimize ให้เราต้อง express intention/explicit หรือใช้ idiom ไม่งั้นอาจจะ generate code ที่เราไม่ต้องการให้

อย่าง https://godbolt.org/z/sre4x39sa

  • ถ้าไม่ใช้ volatile มันจะเปลี่ยนตัวแปรเป็น constant ให้
  • idiom สำหรับ change endian จากที่ต้อง bitwise เยอะๆ เป็น bswap คำสั่งเดียว

ฉะนั้นผมโยนงานพวกนี้ให้ compiler ไปเอาเวลาไปคิดอย่างอื่นดีกว่า