Archive for the 'Revision' Category

April 22, 2006

Three down, one to go

Well, had the old double-whammy yesterday and overall it was a bit disappointing.

Started with Introduction to Topology in the morning. As soon as I turned over the paper and read the first question, I knew that something had been drastically changed. I’ve done the past five years’ worth of papers, and, apart from one year which was done with a different lecturer, the format of the paper hasn’t changed at all. Basically the format is topologies, compactness/connectedness, identification maps/quotient spaces, the fundamental group and finally surfaces.

This year, the overall format was the “same”, but the standard of question was much harder. It came as somewhat of a shock to the system, but I don’t think I’ve done that badly. Amazingly, read the proof of Lebesgue’s lemma, and it came up on the exam. Unfortunately I completely forgot the proof and couldn’t answer in there. Oh well. Somewhat annoying was the lack of any “give without proof examples of…” question which would have been extremely useful. Overall though, I’m hopeful of a mark in the 70–80% region.

Combinatorics was, unfortunately, somewhat of a different story. I (barely) answered 4 questions worth of material, and I think that overall I’ll be quite lucky to get around 50% of the marks, tops. Mostly because I made all of it up. Hopefully there’ll be a certain degree of moderation as I think everybody found the exam quite hard. The annoying thing was the presence of probability stuff in not one, but two of the questions which I found extremely annoying – after all, I have pretty much no knowledge of anything to do with statistics at all.

So we’ll see. One last exam on Monday before three more weeks of revision, and then the second lot starts. But before that, the joy of Measure Theory. That could be very interesting.

10:23 pm | Posted in Exams, Maths, Revision, Warwick Blogs | No Comments »

April 12, 2006

Past Exams and More Programming

Well my brain is thoroughly fried; just completed the 2002–2003 past exam papers for Combinatorics and Topology, and now I can barely concentrate so I’m going to take a large break and try not to think about how much I’m going to screw up Measure Theory. Anyway, thought I’d post another entry and see if I can get myself on a roll. Like that’s going to happen.

So, last night I mainly concentrated on getting this homemade YUV overlay built, and it seems to have worked nicely. The problem wasn’t Mesa, more the fact that I was generating 5 textures/frame, and telling OpenGL to overlay them in a very inefficient way. After spending some time reading up on Cg shaders, I created a basic fragment shader that did the job super quickly with only three textures. So I’m happy.

The other topic on my programming agenda is the blog. I really want to get going on my own website, and the blog is quite an integral part of that. I’m quite picky when it comes to having multiple copies of things, and I don’t like the idea of all of my original blog entries being separate from the blog entries here. So I’m going to have to come up with some way of keeping a central store of blog entries and comments, somehow. I was thinking that I might use a cronjob’d php script to grab entries and comments via RSS or similar, then update the database accordingly. But again, there are problems to this approach – what happens when I get a load of entires on here?

Bah, I’ll have to thnk of something. But besides that, I’ve been playing around with PHP’s PDO objects and they’re very cool. I’ll never have to worry about manually escaping my SQL data again. I’ve created a basic abstraction layer for some common functions, but I’m sitting here wondering whether it’s really worth it. Right now, I’m thinking “probably not”.

So those are the things going on at the moment. I should probably be revising, but I’m sick to death of it by this stage in time. Can’t wait until next year – the more 100% assessed modules, the better.

4:59 pm | Posted in Computing, Maths, Revision, Warwick Blogs | 2 Comments » | Show comments »

April 11, 2006

Damned Revision

Well, it’s been a whole load of time since I posted, mainly due to revision and lazyness on my part. So I thought I’d post a quick update on what I’m doing – not that anyone will be all too interested.

So I’m back in Walsall after spending a week down at Sarah’s. Unfortunately, things haven’t been brilliant on the revision front. Whilst I’m mildly optimistic about Combinatorics, Introduction to Topology and to a lesser extent Topics in Mathematical Biology, I know that Measure Theory is going to be awful. I’ve not done a lot of work for it, and to be honest, I just don’t understand a lot of the material.

However, on the upside, I’ve finished all of my Topology and Topics exercise sheets, which is something that has never been done before. I’m now at the stage where, a week before the dreaded exams, I’m getting my act together and doing three past exam papers a day. So maybe there’s hope yet; we shall see, I suppose. I figure that even if Measure Theory goes badly, I can still pull it up with some better marks from the other modules.

However, I didn’t really want to talk about exams so I’ll talk about something equally as boring – programming. Been playing around quite a bit with two things over the holidays. Firstly – and this has been on the agenda for some time now – coding an OpenGL GStreamer application to map video onto a cube or some other random object. Surprisingly, this was initially very easy, once I’d found out how to actually get the contents of the GStreamer buffer into my program.

Basically I use decodebin to get the video playback working, and then pipe it through ffmpegcolorspace to get a nice RGB texture. Then, I use fakesink and a handoff function to actually generate the texture to screen and map it onto a cube. The hardest bit was actually finding out about the handoff function – it’s buried deep inside the GStreamer Plugin Guide, which is quite annoying. However, it does look quite cool. You can even take a look at it for yourself if you’d like.

Even so, I wasn’t quite satisfied. The biggest speed hump is the ffmpegcolorspace conversion, as generically most video files use some kind of YUV format to store video frames. Typically, and somewhat ashamingly, there’s no general way of dealing with YUV textures in OpenGL – all of the extensions out there generally suck, and don’t work for different versions. Plus, none of them cope with 4:2:0 planar YUV, only 4:2:2 pixel-packed for the most part. So some form of conversion to RGB is required, and a significant amount of CPU overhead is incurred in the process.

For the last couple of weeks I’ve been looking at various ways of efficiently using the GPU to do this conversion for me. Colour matrices were the first option I looked at. Basically, given some texture, one can use a colour matrix to remap colours in any given format. However, the major problem is going from 4:2:0 planar to 4:4:4 pixel packed, and that itself incurs quite a significant overhead.

Blending textures is possibly the best way of doing this. Basically, one generates 5 different textures along with using a simple colour-lookup table. Firstly, we lay down the Y channel as a luminance channel. Then the additive U, then subtractive U, and the same for V. In effect, just layering one channel on top of another to simulate the YUV->RGB conversion in the GPU.

However, there are again problems with this. The naive approach is to redraw texture upon texture, which means that every pixel needs to be redrawn 5 times every frame – at 25fps, that’s 125 times/second! In order to get the most out of the GPU, I used the ARB_multitexture extension, which allows you to layer textures extremely quickly in one pass. I also delved into the world of shaders to try and work out whether it might even be worth usnig only 3 textures and doing the RGB conversion through a simple ARB fragment program. This is something I’m still looking into.

Unfortunately, although this actually works and I’ve tested it, it’s still very very slow. However, I’m using quite a crap Intel 915GM based GPU under Linux. The i915 driver is not particularly good at the moment, and upgrading to Mesa 6.5 seems to have made matters even worse. glxgears is showing only 600fps – I should be getting at least 1300 according to other guys with the same card. So I’m guessing – and hoping – that the problem lies with the drivers and not my card. When I get back, I’m going to check it out on my Radeon 9800 and we’ll see how that copes.

Anyway, that’s probably enough for now. I’m going to reboot and see if I can get this all working nicely.

10:00 pm | Posted in GStreamer, Linux, Maths, Revision, Warwick Blogs | 3 Comments » | Show comments »

June 11, 2005

Six down, one to go

So, I’ve now had another two exams! Woot and all that jazz:

  • Vector Analysis:
    This was great fun - or not. The questions weren’t exactly hard, but answering them in the allocated 2 hours was pretty much impossible for me. There were some interesting questions on there, though; for one, we had to work out:

    The answer turns out to be . Just in case you all wondered.

  • Metric Spaces:
    This went so much better than I expected that it actually scares me. There was an absolutely wonderful question on closure; basically, if with B closed, then . Then some other random things, and it all turned out good.

So now, I have only one exam left; Introduction to Fluids. This one I’m kindof dreading quite a lot, since I think it could be really nasty. However, I’m just going to play it by ear and see how it goes.

Now I’m off to eat some food. More blogging funness later.

1:16 pm | Posted in Exams, LaTeX, Maths, Revision | No Comments »

March 23, 2005

Going insane. Is this bad?

Well, I’ve spent the past three hours doing maths. This is not fun. PDE’s is a pain in the arse, and it’s not working. I am so completely and utterly bored that I think I’ve gone insane.

Oh well.

My plan now is to go and play CS and beat some bots senseless with giant blocks of whoopass.

3:56 pm | Posted in Maths, Revision | No Comments »