Esato Mobile
Sony Ericsson / Sony : Themes, ringtones, screensavers, games, video clips : Official K800/790 Video Thread
> New Topic
> Reply
< Esato Forum Index > Sony Ericsson / Sony > Themes, ringtones, screensavers, games, video clips > Official K800/790 Video Thread Bookmark topic
Page <  123 ... 252627 ... 353637>

dcuk Posts: 121

Hey Mysh

I've been working on it awhile trying to perfect it (ok readers you can stop laughing now! lol ) and thought it might be helpful for M3 in some way,

I understand y1 & y2 should be equal and started out that way but then thought maybe a user might want to crop a DOG from there video and in so doing would have uneven y1 & y2 settings but didn't want them to have to worry about maintaining DAR by guessing x1, x2


Did you manage to get chance to change your PAR to 1.2222 from 1.3333 so M3 will produce correct circles? (looking forward to not having to go through virtualdub first!)

Thank you.

*******************UPDATE************************

PS: after just trying "(y / 3) * 4 = new x" this will work fine if final output is for TV but not for 320x240

as a test using (576 / 3) * 4 = 768 (which is how a CRT displays a 720x576 to correct it's DAR, but doing that with a cropped image and using this calculation it will add distortion as there's no final overscan calculation produced on the output medium in this case the K800i

(I could be completely wrong here too )
_________________
Hope this helps!
Cheers,
Dcuk


[ This Message was edited by: dcuk on 2006-10-24 01:48 ]
--
Posted: 2006-10-24 02:04:42
Edit : Quote

mysh Posts: 176

Nobody has asked for uneven cropping yet, so i haven't looked at it. It seems an unlikely thing to need.

How come you have been working on crop calculation tho? working on some software?

I haven't gotten around to supporting PAR below 1.33 yet, it'll be easy to add tho. Until i came to reply to your post, i hadn't even looked at the cropping code for about 2 months! It's more than a little untidy, you can even see where i've reduced the target aspect ratio from 4 / 3 to 0.75 in some places but not others, terrible really:

Code:
Sub ComputeCrops()
'compute 16:10 > 4:3 aspect horizontal cropping value
iCropH = Convert.ToInt32((iSourceWidth - ((iSourceHeight / 3) * 4)) / 2)
'vob version
If strFileExtension = ".vob" Or bIsDVD = True Then
iCropH = Convert.ToInt32((iSourceWidth - ...
(((iSourceWidth / fSourceAspect) / 3) * 4)) / 2)
End If
If iCropH Mod 2 = 1 Then
iCropH = iCropH - 1
End If
'assign cropping value so long as it's positive value
If iCropH 'compute letterbox removal
iCropVl = Convert.ToInt32((iSourceHeight - (iSourceHeight * 0.75)) / 2)
'vob version
If strFileExtension = ".vob" Or bIsDVD = True Then
Dim newsourceheight As Integer = CInt(iSourceWidth / fSourceAspect)
If Not newsourceheight Mod 2 = 0 Then newsourceheight = newsourceheight - 1
iCropVl = Convert.ToInt32((newsourceheight - (newsourceheight * 0.75)) / 2)
End If
iCropHl = Convert.ToInt32(iCropH + iCropVl)
If iCropHl Mod 2 = 1 Then
iCropHl = iCropHl - 1
End If
If iCropHl If iCropVl Mod 2 = 1 Then
iCropVl = iCropVl - 1
End If
If iCropVl End Sub


lines starting with ' are just comments.

as you can see, aspect ratios wider than 4:3 are considered (eg. 16:10), but i never looked at aspect ratios narrower than 4:3 such as 5:4.

I'll overhaul that code before the next release and make it use the detected par in all cases (5:4, 16:9 etc).

[ This Message was edited by: mysh on 2006-10-24 01:51 ]
--
Posted: 2006-10-24 02:22:12
Edit : Quote

dcuk Posts: 121

I just updated my last post above

you are using 0.75

I was using 0.77 (Don't ask ) but then found 0.67 to be more accurate if you are referring to converting anamorphic, even had a string of y*1.2222*0.67=x until I found using 2.04 produced to same results (well it does for me)


Just a quick PS: please can you shorten the length of your _____ line in above post so forum goes back to normal width, thank you

PPS: you never know someone else might want uneven borders I've needed them in the past!

_________________
Hope this helps!
Cheers,
Dcuk


[ This Message was edited by: dcuk on 2006-10-24 01:54 ]
--
Posted: 2006-10-24 02:43:15
Edit : Quote

mysh Posts: 176

edited it to shrink it a little, if you like i'll just remove the code. I thought if you were writing some code yourself it might prove handy.

PAL TV is 1.25 (5:4) ratio. I get what you mean about it being wrong on the phone screen, which is 1.33 (4:3). Basically the TV does it's own 4:3 DAR on the 5:4 PAR tv signal. See below on 'narrowscreen' video about this.

essentially i am using a value of 0.75 because that is the target screen ratio of height to width, 3/4 = 0.75.

so for ANY widescreen video with a ratio of anything above 1.33 (4:3), you take the height, and multiply it by 0.75 to find out what the new width should be to make it proportionally perfect on a 4:3 screen. Does that makes sense?

In the case of PAL signal tv captures, it's a 'narrowscreen' video, so you need to do the opposite... 720/576 = 5/4 = 1.25 aspect. You crop a tiny amount off the top and bottom (instead of the sides) to fit to 4:3 fullscreen, yet keep perfect proportions (perfect circles).

The actual math would be:

crop from top and bottom = (Res Y - (ResX * 0.75)) / 2



i understand you're using 0.77 then 0.67 to account for overscan and the TVs own DAR, but this isn't neccessary, as a TV overscans in both X and Y dimensions. 0.75 is the phone aspect, which is what we're targetting, it's perfect. The cropping is like only doing the vertical part of the TV overscan, it's not to replicate the TV overscan tho, it's to fix the PAR.

Really i should just change the * 0.75 to / 1.33, it's the same thing, and would make this a lot less confusing to read!

trying to combine both the target aspect and source aspect into one value like 2.02 works fine if your source aspect is always the same. But only then. It's better to compute source aspect on-the-fly, with a simple rule to distinguish between the two cases of 1.33 aspect.

That way you can deal with video of any proportions accurately and easily.

In that earlier post i mentioned i'll add support for aspect's below 1.33, and what i meant was adding that vertical crop for 'narrowscreen' 5:4 captured video, and any other video under 1.33 aspect.

I should admit, i don't specifically know how exactly a TV converts the 5:4 signal to a DAR of 4:3, it may use non-square pixels in the CRT. I am aware that overscan occurs horizontally as well as vertically though.


[ This Message was edited by: mysh on 2006-10-24 02:33 ]
--
Posted: 2006-10-24 03:23:26
Edit : Quote

dcuk Posts: 121

720x576 is 1.2222 because 8 pixels either side normally arn't used in almost all DTV broadcasts (I read a complex article on it months ago explaining why they do this, I'll try and find it for you later on today)

Have a peep at the frame grabs I posted before to help explain
http://www.esato.com/board/viewtopic.php?topic=125517&start=180

I used to use 1.25 on the k750i as the media player adds tiny black borders top and bottom to 128x96 video as it can't quite stretch it to fill the frame so 1.25 produced true circles on screen

I've tested lots and lots of videos (honestly!) and really 1.2222 seems to look perfect on the k800i screen (I've even paused videos and mesured circles both ways to see how round they are (sad I know lol)),

infact I'll encode some small files size videos in the different DAR's so you can try them on your phone

_________________
Hope this helps!
Cheers,
Dcuk

[ This Message was edited by: dcuk on 2006-10-24 03:07 ]
--
Posted: 2006-10-24 03:58:15
Edit : Quote

mysh Posts: 176

hehe ok this getting silly now.

on the pics you posted on page 13, the 1.22 image is the same as doing the 'narrowscreen' vertical cropping i just mentioned.

Compared to the 1.33 image, you just cropped a few pixels from the top and bottom. You shorten the image height while maintaining the image width, essentially 'squashing' down the image slightly when it comes time to resize to 320x240.

This is exactly what will be in the next version of m3! I can also add a function to remove those 8 dead pixels on the sides prior to computing the vertical crop, if that'd be handy?
--
Posted: 2006-10-24 04:05:05
Edit : Quote

dcuk Posts: 121

I agree it is and we shouldn't hog the thread

I honestly didn't squash the shots vertically they are true screen grabs from virtualdub output window with the different PAR settings, I'll send you them later today. each picture is 320x240

PS: goto page 13 and right click the images and 'save as' to your desktop then check the properties for each image

***UPDATE:***
Each image's width is altered only to test different PAR settings before being converted to 320x240

I prefer to alter width rather than height as the vertical crop is usally goverened by the need to remove just the black bars and no more.

Thank you for taking the time to discuss this subject and share your views.
_________________
Hope this helps!
Cheers,
Dcuk

[ This Message was edited by: dcuk on 2006-10-24 04:10 ]
--
Posted: 2006-10-24 04:20:18
Edit : Quote

mysh Posts: 176

Email me if you want to discuss this more tho.

Basically the PAR setting in vdub will change the vertical proportions. So none of the image is cropped, just squashed a bit. I think those two screens you posted were from different frames, so it looked like the screen edge had been trimmed to me at first.

M3 will crop maybe 40 pixels from the 720 width to achieve the same effect. That should only be the overscan area, so no vital information will be lost. I could look at doing vertical resizing instead if you'd really prefer tho.

[ This Message was edited by: mysh on 2006-10-24 03:48 ]
--
Posted: 2006-10-24 04:46:11
Edit : Quote

dcuk Posts: 121

Hi everyone,

Mysh has been busy again and here is the latest version of M3
http://www.vapulus.com/w900i/M3-0.8.8.4-Installer.exe

Dont forget you need .net framework version 2 for M3 to work!
http://www.microsoft.com/down[....]DD-AAB15C5E04F5&displaylang=en


_________________
Hope this helps!
Cheers,
Dcuk

[ This Message was edited by: dcuk on 2006-10-24 19:05 ]
--
Posted: 2006-10-24 20:03:59
Edit : Quote

dcuk Posts: 121

Well I feel really silly now as I've found out my Anamorphic cropping ratio algorithm is very wrong Oh well!

So I've reverted back to my old method which works every time but is a bit long winded

manually crop away (y1) & (y2) then

(then what's left is) (y3)*0.9152-720/2 = cropping sizes for (x1 & x2)

this is for cropping Anamorphic videos only!
_________________
Hope this helps!
Cheers,
Dcuk

[ This Message was edited by: dcuk on 2006-10-27 01:26 ]
--
Posted: 2006-10-25 01:00:41
Edit : Quote
Page <  123 ... 252627 ... 353637>

New Topic   Reply
Forum Index

Esato home