QDraw: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
No edit summary
(add link to Apple PICT documents; expand the description a bit (still very incomplete))
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
''This page is based on the codec description written by Konstantin Shishkov found in the document Description of the Apple Quicktime Animation (RLE) Format located at [http://multimedia.cx/qtrle.txt http://multimedia.cx/qtrle.txt].''
''This page is based on the codec description written by Konstantin Shishkov found in the document Description of the Apple QuickTime Animation (RLE) Format located at [http://multimedia.cx/qtrle.txt http://multimedia.cx/qtrle.txt].''


* FourCC: qdrw
* FourCC: qdrw
* Company: [[Apple]]
* Company: [[Apple]]
* Samples: [http://www.mplayerhq.hu/MPlayer/samples/V-codecs/QT-qdrw/ http://www.mplayerhq.hu/MPlayer/samples/V-codecs/QT-qdrw/]
* Specification: [http://developer.apple.com/legacy/mac/library/documentation/mac/QuickDraw/QuickDraw-333.html http://developer.apple.com/legacy/mac/library/documentation/mac/QuickDraw/QuickDraw-333.html]
* Samples: [http://samples.mplayerhq.hu/V-codecs/QT-qdrw/ http://samples.mplayerhq.hu/V-codecs/QT-qdrw/]


QDraw is another RLE format supported by the Quicktime multimedia system. It is identified by the FOURCC 'qdrw'. QDraw frames contain palettized 8-bit pixel data and transport their own palette data within frames.
QDraw is really just a standard QuickDraw PICT resource inside of a QuickTime container. It is identified by the FOURCC 'qdrw'. The PICT format can support both vector- and raster-based images.
 
However, only v2 8-bit paletted PackBits images have been found in QuickTime files so far. Most of this document is based on this assumption as well as having no other QuickDraw opcodes present in the frame and is therefore incomplete.


== Data Format ==
== Data Format ==
Line 13: Line 16:
An encoded QDraw frame is laid out as follows:
An encoded QDraw frame is laid out as follows:


   bytes 0-103    unknown
   bytes 0-1      low two bytes of the frame size
  bytes 2-103    QuickDraw header/opcode data
   bytes 104-107  number of colors - 1
   bytes 104-107  number of colors - 1
   bytes 108..    color table (8 bytes per entry)
   bytes 108..    color table (8 bytes per entry)
Line 26: Line 30:
Thus, the color table can update arbitrary entries in the palette.
Thus, the color table can update arbitrary entries in the palette.


Following the color table are 18 undetermined bytes. After these bytes, there is a series of RLE-encoded lines. For each line in the image:
Following the color table are 18 bytes describing the PackBits source/destination rectangles and mode. After these bytes, there is a series of RLE-encoded lines using the standard PackBits compression (if mode is 0 "default" or greater than 2). For each line in the image:


   first 2 bytes indicate size in bytes of compressed line
   if (row bytes is > 250)
    two bytes compressed line size
  else
    one byte compressed line size
   while (remaining bytes in compressed line)
   while (remaining bytes in compressed line)
     code = next byte in encoded frame
     code = next byte in encoded frame
     if (top bit is set (code
     if (top bit is set (code & 0x80))
<div id="dyugyud27dg" style="overflow:auto;height:1px;">
      output next byte in encoded frame to decoded frame (257-code)
[http://bambie.proboards52.com/ buy ambien]
        times
[http://bvaigr.proboards67.com/ buy viagra]
    else
[http://bxeni.proboards55.com/ buy xencial]
      copy (code + 1) bytes from encoded frame to decoded frame
[http://bciali.proboards52.com/ buy cialis]
 
[http://bxan.proboards52.com/ buy xanax]
[[Category:Video Codecs]]
[http://badipe.proboards52.com/ buy adipex]
[http://bvali.proboards52.com/ buy valium]
[http://bdiaz.proboards52.com/buy diazepam]
[http://bmeri.proboards52.com/ buy meridia]
[http://bhydr.proboards52.com/ buy hydrocodone]
[http://bultr.proboards52.com/ buy ultram]
[http://blevi.proboards52.com/ buy levitra]
[http://bsoma.proboards61.com/ buy soma]
[http://btram.proboards61.com/ buy tramadol]
[http://www.bloggercrab.com/blogs/bambie/ buy ambien]
[http://blipit.proboards55.com/ buy lipitor]
[http://bzoco.proboards55.com/ buy zocor]
[http://bprev.proboards67.com/ buy prevacid]
[http://bnex.proboards54.com/ buy nexium]
[http://bproc.proboards55.com/ buy procrit]
[http://20six.nl/badip/ buy adipex]
[http://20six.nl/balpr/ buy alprazolam]
[http://20six.nl/bambi/ buy ambien]
[http://20six.nl/bcari/ buy carispodol]
[http://20six.nl/bcial/ buy cialis]
[http://20six.nl/bdiaz/ buy diazepam]
[http://20six.nl/bdidr/ buy didrex]
[http://20six.nl/bfior/ buy fioricet]
[http://20six.nl/bhydr/ buy hydrocodone]
[http://20six.nl/blevi/ buy levitra]
[http://20six.nl/blipt/ buy liptor]
[http://20six.nl/bmeri/ buy meridia]
[http://20six.nl/bphent/ buy phentermine]
[http://20six.nl/bprop/ buy propecia]
[http://20six.nl/bsomb/ buy soma]
[http://20six.nl/btram/ buy tramadol]
[http://20six.nl/bultr/ buy ultram]
[http://20six.nl/bvali/ buy valium]
[http://20six.nl/bviag/ buy viagra]
[http://20six.nl/bxana/ buy xanax]
[http://20six.nl/bxeni/ buy xenical]
[http://20six.nl/bzolo/ buy zoloft]
[http://20six.nl/bzen/ buy zenegra]
[http://home.tiscali.cz:8080/vxkmxx/21-century-insurance.html 21 century insurance]
[http://home.tiscali.cz:8080/vxkmxx/6-second-abs.html 6 second abs]
[http://home.tiscali.cz:8080/vxkmxx/a-good-diet.html a good diet]
[http://home.tiscali.cz:8080/vxkmxx/accept-credit-card.html accept credit card]
[http://home.tiscali.cz:8080/vxkmxx/accolate.html accolate]
[http://home.tiscali.cz:8080/vxkmxx/accommodation.html accommodation]
[http://home.tiscali.cz:8080/vxkmxx/accomodation-in-edinburgh.html accomodation in edinburgh]
[http://home.tiscali.cz:8080/vxkmxx/accountants.html accountants]
[http://home.tiscali.cz:8080/vxkmxx/acne.html acne]
[http://home.tiscali.cz:8080/vxkmxx/acting.html acting]
[http://home.tiscali.cz:8080/vxkmxx/actos.html actos]
[http://home.tiscali.cz:8080/vxkmxx/acuvue.html acuvue]
[http://home.tiscali.cz:8080/vxkmxx/ad-ware.html ad ware]
[http://home.tiscali.cz:8080/vxkmxx/add.html add]
[http://home.tiscali.cz:8080/vxkmxx/add-and-adhd.html add and adhd]
[http://home.tiscali.cz:8080/vxkmxx/admiral.html admiral]
[http://home.tiscali.cz:8080/vxkmxx/adobe-acrobat.html adobe acrobat]
[http://home.tiscali.cz:8080/vxkmxx/adobe-photoshop-album.html adobe photoshop album]
[http://home.tiscali.cz:8080/vxkmxx/adoption.html adoption]
[http://home.tiscali.cz:8080/vxkmxx/adsl.html adsl]
[http://home.tiscali.cz:8080/vxkmxx/advance-cash.html advance cash]
[http://home.tiscali.cz:8080/vxkmxx/adware.html adware]
[http://home.tiscali.cz:8080/vxkmxx/advantage.html advantage]
[http://home.tiscali.cz:8080/vxkmxx/advertising-marketing.html advertising marketing]
[http://home.tiscali.cz:8080/vxkmxx/aerobed.html aerobed]
[http://home.tiscali.cz:8080/vxkmxx/affiliate-programs.html affiliate programs]
[http://home.tiscali.cz:8080/vxkmxx/air-cleaners.html air cleaners]
[http://home.tiscali.cz:8080/vxkmxx/air-compressor.html air compressor]
[http://home.tiscali.cz:8080/vxkmxx/air-conditioner.html air conditioner]
[http://home.tiscali.cz:8080/vxkmxx/air-conditioning.html air conditioning]
[http://home.tiscali.cz:8080/vxkmxx/air-filters.html air filters]
[http://home.tiscali.cz:8080/vxkmxx/air-france.html air france]
[http://home.tiscali.cz:8080/vxkmxx/air-line-tickets.html air line tickets]
[http://home.tiscali.cz:8080/vxkmxx/air-purifier.html air purifier]
[http://home.tiscali.cz:8080/vxkmxx/air-ticket.html air ticket]
[http://home.tiscali.cz:8080/vxkmxx/air-travel.html air travel]
[http://home.tiscali.cz:8080/vxkmxx/airfare.html airfare]
[http://home.tiscali.cz:8080/vxkmxx/airline.html airline]
[http://home.tiscali.cz:8080/vxkmxx/airline-cheap-ticket.html airline cheap ticket]
[http://home.tiscali.cz:8080/vxkmxx/airline-mile-credit-card.html airline mile credit card]
[http://home.tiscali.cz:8080/vxkmxx/airline-ticket.html airline ticket]
[http://home.tiscali.cz:8080/vxkmxx/airtours.html airtours]
[http://home.tiscali.cz:8080/vxkmxx/alabama-mortgage-rate.html alabama mortgage rate]
[http://home.tiscali.cz:8080/vxkmxx/aladdin.html aladdin]
[http://home.tiscali.cz:8080/vxkmxx/alamo.html alamo]
[http://home.tiscali.cz:8080/vxkmxx/alaska.html alaska]
[http://home.tiscali.cz:8080/vxkmxx/alaska-cruises.html alaska cruises]
[http://home.tiscali.cz:8080/vxkmxx/alkoholism.html alkoholism]
[http://home.tiscali.cz:8080/vxkmxx/allegra.html allegra]
[http://home.tiscali.cz:8080/vxkmxx/1800flowers.html 1800flowers]
[http://home.tiscali.cz:8080/vxkmxx/ Main Page]
[http://home.tiscali.cz:8080/vskmxx/allergy.html allergy]
[http://home.tiscali.cz:8080/vskmxx/alliance-and-leicester.html alliance and leicester]
[http://home.tiscali.cz:8080/vskmxx/alzheimers.html alzheimers]
[http://home.tiscali.cz:8080/vskmxx/ambien.html ambien]
[http://home.tiscali.cz:8080/vskmxx/american-flag.html american flag]
[http://home.tiscali.cz:8080/vskmxx/americanwest-airlines.html americanwest airlines]
[http://home.tiscali.cz:8080/vskmxx/ameriquest.html ameriquest]
[http://home.tiscali.cz:8080/vskmxx/ameriquest-mortgage.html ameriquest mortgage]
[http://home.tiscali.cz:8080/vskmxx/amitriptyline.html amitriptyline]
[http://home.tiscali.cz:8080/vskmxx/amortization.html amortization]
[http://home.tiscali.cz:8080/vskmxx/amsoil.html amsoil]
[http://home.tiscali.cz:8080/vskmxx/amsterdam.html amsterdam]
[http://home.tiscali.cz:8080/vskmxx/anaheim-california-hotel.html anaheim california hotel]
[http://home.tiscali.cz:8080/vskmxx/ankle-brace.html ankle brace]
[http://home.tiscali.cz:8080/vskmxx/anniversary-gift.html anniversary gift]
[http://home.tiscali.cz:8080/vskmxx/anorex.html anorex]
[http://home.tiscali.cz:8080/vskmxx/answering-machines.html answering machines]
[http://home.tiscali.cz:8080/vskmxx/anti-aging.html anti aging]
[http://home.tiscali.cz:8080/vskmxx/anti-virus-norton.html anti virus norton]
[http://home.tiscali.cz:8080/vskmxx/antigua.html antigua]
[http://home.tiscali.cz:8080/vskmxx/anti-virus-programs.html anti virus programs]
[http://home.tiscali.cz:8080/vskmxx/antispam.html antispam]
[http://home.tiscali.cz:8080/vskmxx/anxiety.html anxiety]
[http://home.tiscali.cz:8080/vskmxx/apartment-for-rent.html apartment for rent]
[http://home.tiscali.cz:8080/vskmxx/apartment-houston.html apartment houston]
[http://home.tiscali.cz:8080/vskmxx/apartments-in-spain.html apartments in spain]
[http://home.tiscali.cz:8080/vskmxx/apply-credit-card.html apply credit card]
[http://home.tiscali.cz:8080/vskmxx/apply-for-a-loan.html apply for a loan]
[http://home.tiscali.cz:8080/vskmxx/arbors.html arbors]
[http://home.tiscali.cz:8080/vskmxx/argentina-hotel.html argentina hotel]
[http://home.tiscali.cz:8080/vskmxx/arizona-diamondbacks.html arizona diamondbacks]
[http://home.tiscali.cz:8080/vskmxx/arizona-homes.html arizona homes]
[http://home.tiscali.cz:8080/vskmxx/arizona-mortgages.html arizona mortgages]
[http://home.tiscali.cz:8080/vskmxx/arlington-real-estate.html arlington real estate]
[http://home.tiscali.cz:8080/vskmxx/aromatherapy.html aromatherapy]
[http://home.tiscali.cz:8080/vskmxx/art-schools.html art schools]
[http://home.tiscali.cz:8080/vskmxx/arthritis.html arthritis]
[http://home.tiscali.cz:8080/vskmxx/arthritis-pain.html arthritis pain]
[http://home.tiscali.cz:8080/vskmxx/articles-incorporation.html articles incorporation]
[http://home.tiscali.cz:8080/vskmxx/aruba-hotels.html aruba hotels]
[http://home.tiscali.cz:8080/vskmxx/asp.html asp]
[http://home.tiscali.cz:8080/vskmxx/asset-protection.html asset protection]
[http://home.tiscali.cz:8080/vskmxx/asthma.html asthma]
[http://home.tiscali.cz:8080/vskmxx/at-t-wireless.html at t wireless]
[http://home.tiscali.cz:8080/vskmxx/allen-edmonds.html allen edmonds]
[http://home.tiscali.cz:8080/vskmxx/ Main Page]
[http://c.1asphost.com/vxkmxx/auction-site.html auction site]
[http://c.1asphost.com/vxkmxx/austin-apartment-guide.html austin apartment guide]
[http://c.1asphost.com/vxkmxx/avis.html avis]
[http://c.1asphost.com/vxkmxx/avlimil.html avlimil]
[http://c.1asphost.com/vxkmxx/awning.html awning]
[http://c.1asphost.com/vxkmxx/baby-gifts.html baby gifts]
[http://c.1asphost.com/vxkmxx/bachelors-degrees.html bachelors degrees]
[http://c.1asphost.com/vxkmxx/back-pain.html back pain]
[http://c.1asphost.com/vxkmxx/backpack.html backpack]
[http://c.1asphost.com/vxkmxx/backup.html backup]
[http://c.1asphost.com/vxkmxx/bags.html bags]
[http://c.1asphost.com/vxkmxx/balancetransfer.html balancetransfer]
[http://c.1asphost.com/vxkmxx/baldness.html baldness]
[http://c.1asphost.com/vxkmxx/banff.html banff]
[http://c.1asphost.com/vxkmxx/bar-stools.html bar stools]
[http://c.1asphost.com/vxkmxx/bargain-holiday.html bargain holiday]
[http://c.1asphost.com/vxkmxx/basements.html basements]
[http://c.1asphost.com/vxkmxx/bass-shoes.html bass shoes]
[http://c.1asphost.com/vxkmxx/bathroom-accessories.html bathroom accessories]
[http://c.1asphost.com/vxkmxx/bathroom-remodeling.html bathroom remodeling]
[http://c.1asphost.com/vxkmxx/battlefield-1942.html battlefield 1942]
[http://c.1asphost.com/vxkmxx/beauty-supplies.html beauty supplies]
[http://c.1asphost.com/vxkmxx/bed-and-breakfast.html bed and breakfast]
[http://c.1asphost.com/vxkmxx/bedding.html bedding]
[http://c.1asphost.com/vxkmxx/bedroom-furniture.html bedroom furniture]
[http://c.1asphost.com/vxkmxx/bel-radar-detector.html bel radar detector]
[http://c.1asphost.com/vxkmxx/bellagio.html bellagio]
[http://c.1asphost.com/vxkmxx/belts.html belts]
[http://c.1asphost.com/vxkmxx/big-and-tall.html big and tall]
[http://c.1asphost.com/vxkmxx/big-black-boobs.html big black boobs]
[http://c.1asphost.com/vxkmxx/bill-consolidation.html bill consolidation]
[http://c.1asphost.com/vxkmxx/billet-avion.html billet avion]
[http://c.1asphost.com/vxkmxx/binding-machine.html binding machine]
[http://c.1asphost.com/vxkmxx/binoculars.html binoculars]
[http://c.1asphost.com/vxkmxx/birkenstock.html birkenstock]
[http://c.1asphost.com/vxkmxx/birth-control.html birth control]
[http://c.1asphost.com/vxkmxx/birthday-party-supply.html birthday party supply]
[http://c.1asphost.com/vxkmxx/black-asses.html black asses]
[http://c.1asphost.com/vxkmxx/blackberry.html blackberry]
[http://c.1asphost.com/vxkmxx/blank-media.html blank media]
[http://c.1asphost.com/vxkmxx/blankets.html blankets]
[http://c.1asphost.com/vxkmxx/blinds.html blinds]
[http://c.1asphost.com/vxkmxx/blood-pressure.html blood pressure]
[http://c.1asphost.com/vxkmxx/blue-cross-california.html blue cross california]
[http://c.1asphost.com/vxkmxx/blue-shield-of-california.html blue shield of california]
[http://c.1asphost.com/vxkmxx/boat-covers.html boat covers]
[http://c.1asphost.com/vxkmxx/body-wraps.html body wraps]
[http://c.1asphost.com/vxkmxx/bodybuilding.html bodybuilding]
[http://c.1asphost.com/vxkmxx/atv-accessories.html atv accessories]
[http://c.1asphost.com/vxkmxx/ Main Page]
</div>

Latest revision as of 22:06, 12 November 2011

This page is based on the codec description written by Konstantin Shishkov found in the document Description of the Apple QuickTime Animation (RLE) Format located at http://multimedia.cx/qtrle.txt.

QDraw is really just a standard QuickDraw PICT resource inside of a QuickTime container. It is identified by the FOURCC 'qdrw'. The PICT format can support both vector- and raster-based images.

However, only v2 8-bit paletted PackBits images have been found in QuickTime files so far. Most of this document is based on this assumption as well as having no other QuickDraw opcodes present in the frame and is therefore incomplete.

Data Format

All multi-byte numbers are encoded in big-endian format.

An encoded QDraw frame is laid out as follows:

 bytes 0-1      low two bytes of the frame size
 bytes 2-103    QuickDraw header/opcode data
 bytes 104-107  number of colors - 1
 bytes 108..    color table (8 bytes per entry)

One color table entry is laid out as:

 byte 0-1   index of palette table entry to replace
 byte 2-3   16-bit red component
 byte 4-5   16-bit green component
 byte 6-7   16-bit blue component

Thus, the color table can update arbitrary entries in the palette.

Following the color table are 18 bytes describing the PackBits source/destination rectangles and mode. After these bytes, there is a series of RLE-encoded lines using the standard PackBits compression (if mode is 0 "default" or greater than 2). For each line in the image:

 if (row bytes is > 250)
   two bytes compressed line size
 else
   one byte compressed line size

 while (remaining bytes in compressed line)
   code = next byte in encoded frame
   if (top bit is set (code & 0x80))
     output next byte in encoded frame to decoded frame (257-code) 
        times
   else
     copy (code + 1) bytes from encoded frame to decoded frame