summaryrefslogtreecommitdiffstats
path: root/libhb/muxmp4.c
diff options
context:
space:
mode:
authorritsuka <[email protected]>2008-02-17 17:05:24 +0000
committerritsuka <[email protected]>2008-02-17 17:05:24 +0000
commit0cd095c568431b991f9b8f6899f9c46e60cb983b (patch)
tree4932bed3e28c71d249dc0d2320389e925323a834 /libhb/muxmp4.c
parent2bc8b2d4147eefd03b9d6854a62ea6c4adb53a58 (diff)
Remove the transformation matrix, and use the width field of the tkhd atom to do anamorphic in quicktime based players and devices.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1280 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/muxmp4.c')
-rw-r--r--libhb/muxmp4.c55
1 files changed, 2 insertions, 53 deletions
diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c
index 3f043dbdd..8f9ba1a0e 100644
--- a/libhb/muxmp4.c
+++ b/libhb/muxmp4.c
@@ -242,61 +242,10 @@ static int MP4Init( hb_mux_object_t * m )
height = job->pixel_aspect_height;
MP4AddPixelAspectRatio(m->file, mux_data->track, (uint32_t)width, (uint32_t)height);
+
+ MP4SetTrackFloatProperty(m->file, mux_data->track, "tkhd.width", job->width * (width / height));
}
-
- if( job->pixel_ratio ) {
- /* apply the anamorphic transformation matrix as well */
- uint8_t* val;
- uint8_t nval[38];
- uint32_t *ptr32 = (uint32_t*) (nval + 2);
- uint32_t size;
-
- MP4GetBytesProperty(m->file, "moov.trak.tkhd.reserved3", &val, &size);
-
- if (size == 38) {
-
- memcpy(nval, val, size);
-
- float width, height;
- width = job->pixel_aspect_width;
- height = job->pixel_aspect_height;
-
- uint32_t pixelRatioInt;
- if (width >= height)
- {
- pixelRatioInt = (uint32_t)((width / height) * 0x10000);
-
-#ifdef WORDS_BIGENDIAN
- ptr32[0] = pixelRatioInt;
-#else
- /* we need to switch the endianness, as the file format expects big endian */
- ptr32[0] = ((pixelRatioInt & 0x000000FF) << 24) + ((pixelRatioInt & 0x0000FF00) << 8) + ((pixelRatioInt & 0x00FF0000) >> 8) + ((pixelRatioInt & 0xFF000000) >> 24);
-#endif
-
- }
- else
- {
- pixelRatioInt = (uint32_t)((height / width) * 0x10000);
-#ifdef WORDS_BIGENDIAN
- ptr32[4] = pixelRatioInt;
-#else
- /* we need to switch the endianness, as the file format expects big endian */
- ptr32[4] = ((pixelRatioInt & 0x000000FF) << 24) + ((pixelRatioInt & 0x0000FF00) << 8) + ((pixelRatioInt & 0x00FF0000) >> 8) + ((pixelRatioInt & 0xFF000000) >> 24);
-#endif
- }
-
-
- if(!MP4SetBytesProperty(m->file, "moov.trak.tkhd.reserved3", nval, size)) {
- hb_log("Problem setting transform matrix");
- }
-
- }
-
- }
-
- /* end of transformation matrix */
-
/* firstAudioTrack will be used to reference the first audio track when we add a chapter track */
MP4TrackId firstAudioTrack = 0;