2010/10/30

On funding the BBC

It looks like we're going to see another debate on the future of the BBC in the not too distant future. I happen to believe that the BBC plays two important roles in UK television, so I'm not in favour of anything that guts it; I do, however believe that those two roles could be improved by a change to the BBC's funding.

So, firstly, what do I think the BBC does that's important?

  1. It takes risks. The BBC can do a programme like Sherlock, which could easily have been a complete disaster, because it doesn't have to worry about making a profit on every slot.
  2. It produces programming for minority interests. The BBC can broadcast the Paralympic Games knowing that the majority of people would prefer to watch football or mainstream athletics, because its funding method means that it can do the right thing anyway.

Further, having broadcast risky or minority programmes, the BBC sometimes ends up demonstrating to commercial broadcasters that their intuitions on what's potentially profitable are wrong; thus, it also stops the commercial channels descending into wall-to-wall dross, because they know that their viewers can always switch to the BBC.

Given these priorities, the BBC's funding mechanism needs to give them incentives to take risks rather than play it safe, and to worry about providing something for everyone rather than something for the few. As always when I present a problem, I have an idea to solve it.

To understand my suggestion, you first need to understand the audience measurement concepts of reach and audience size.

Audience size is really simple - just count everyone who watches a programme, or a channel, or a group of channels. There are some slight complexities here, such as deciding when someone counts as having watched a programme, but it's otherwise not hard.

Reach is a much more complex measurement; you have to count the number of unique viewers. The important thing about reach is that you can't just appeal to the same viewers again and again to increase your reach - you have to bring in new people each time.

A very simple example; imagine two TV stations, 1 and 2, and 6 people, A to F, and the following audience figures:

Time of dayStation 1 viewersStation 2 viewers
6pm to 7pmA, B, CD
7pm to 8pmB, C, DE, F
8pm to 9pmC, DA, B
9pm to 10pmA, B, DC, F

By audience size (the most commonly quoted rating), station 1 consistently equals or beats station 2; with the exception of the 8pm to 9pm timeslot, it has more viewers in every timeslot. However, on a reach rating, station 2 beats station 1 - it reaches 100% of the audience over that evening, whereas station 1 keeps attracting the same viewers again and again to get a 67% reach.

With my terms explained (albeit badly), I can explain my proposal. I intend to reuse the BARB reach measurement for TV, and the RAJAR reach measurement for radio, as they're already taken anyway for the benefit of commercial broadcasters. I'm ignoring the BBC's online services completely, for these purposes; I believe that there's enough competition online, and it's easy enough to find, that the BBC is not needed as an aid to competition.

The BBC would have to face two measurements in my world. First, it would be measured on the reach of its television services alone; it must reach 99% of households with a TV licence. This allows for a small number of law-abiding households that don't watch the BBC on philosophical grounds, but still forces the BBC to provide something for everyone. If the BBC fails to achieve this, it has to "buy" ratings from the commercial and state broadcasters until it has the 99% figure; note that because it's buying historic ratings, it has to buy programming that helps it achieve its reach goal, thus giving commercial broadcasters an incentive to find a minority interest that the BBC does not service.

The second measurement includes both TV and radio services, and controls the BBC's future funding. For each of the two figures, you end up with three outcomes:

  1. Reach increased compared to last year.
  2. Reach the same as last year (within error bounds).
  3. Reach decreased compared to last year.

If either reach figure decreases, the BBC is limited to an inflation-only rise in income; if both decrease, the BBC's revenue is not increased at all. This gives the BBC a strong incentive to avoid losing reach - lose reach in one medium, and you're limited to an inflation-only rise in income. Lose reach in both media, and you're making cuts.

If one figure rises, and the other stays the same, the BBC is permitted a small increase over and above inflation - say the lower of 5% or the inflation rate. If the BBC can make both reach figures rise, it's permitted a larger increase - say the lower of 10% or four times the inflation rate. In both cases, the tie to inflation ensures that the BBC never grows rapidly; but by tying increases to reach, the BBC is prevented from growing at all unless it can appeal to more of the population than before.

Obviously, this is just an outline, and thus rather incomplete - but hopefully my thinking is clear.

2010/10/17

OFDM - a technology miracle I've only just started to understand

In an attempt to stave off the winter blues, I've been trying to get a detailed understanding of technologies I depend on for everyday life. Most recently, I've been trying to get a handle on OFDM - the underlying modulation scheme in ADSL and in DVB-T.
To understand why OFDM is such an amazing invention, you first have to understand a little about digital transmission of data. At heart, digital modulation schemes are all simply ways of converting the digital signal (ones and zeros) to an analogue signal that can both be transmitted easily, and then decoded easily at the other end.
There are three basic classes of digital modulation:
  1. Amplitude modulation. In these, you're looking at different signal levels to get different bit patterns - for example, you might have a rule that says "loud signal is a 1, quiet signal is a 0". The advantage here is simplicity - to implement the transmitter and receiver for these modulation schemes is easy (a morse code transmitter and receiver are an amplitude modulation scheme). The disadvantage is that it's very prone to being disrupted by noise or imperfections in the transmission channel, so you struggle to approach the Shannon limit.
  2. Frequency modulation. In these, you look at the frequencies of the signal to determine what bit pattern is being transmitted - for example, you might say that "2kHz (high) pitch is a 1, 200Hz (low) pitch is a 0". DTMF in touch-tone phones is an example of a frequency modulation scheme. Again, these systems are simple (although not quite as simple to implement as amplitude systems), but they're still easily disrupted by some classes of noise.
  3. Phase modulation. In these schemes, you represent data by a phase shift - this is much harder to decode, but has the advantage of being much more noise resistant than any of the other modulation schemes.
There's a particular combination of phase and amplitude modulation that's commonly used for its efficiency and noise resistance, called quadrature amplitude modulation (QAM). In QAM, you take two carriers at the same frequency, but 90° out of phase with each other. You control the amplitude of each carrier at the same time, using the amplitudes of each signal to select a point in a constellation - each of these points represents a different bit pattern.
By changing the amplitude of two waves that are 90° apart in phase, and combining them, we effectively shift both phase and amplitude of the signal at the same time, resulting in QAM being a mixture of phase and amplitude modulation, and getting some of the advantages of both, at the expense of a more complex receiver.
So, how does this all tie into OFDM? Well, firstly, you need to recall some basic trigonometry; QAM uses two carriers 90° out of phase with each other. Another way of looking at this is that QAM uses the sine and cosine waves at a given frequency and phase as its carrier pair. The first step of a QAM demodulator separates out the received signal into the cosine and the sin wave at that frequency.

The other bit of information you need to make OFDM make sense is to realise that signal impairments (noise, attenuation, multipath interference etc) don't affect all frequencies easily. For example, attenuation in a length of copper wire goes up as the frequency of the signal goes up; electronic equipment emits noise at various frequencies, but concentrated around some specific (equipment-dependent) frequencies - such as 33MHz for a PC with a PCI bus.

So, finally, onto OFDM; the basic idea is that rather than try and use the entire channel bandwidth to transmit a single high bitrate signal (as is done in Ethernet, for example), we'll split the channel into lots of narrow channels, and transmit a low bitrate signal on each of them. We can then recombine all the low bitrate signals together into the original high bitrate signal at the other end.

This sounds expensive, at first sight; 802.11a/g use OFDM with relatively few carriers (52), yet some applications, like DVB-T, can use thousands of carriers. If we had to have a full-blown QAM receiver for each carrier, it would be impossible to afford; here's where the miracle comes in. There's a mathematical trick, called the Fourier transform, which can split your incoming signal by frequency, giving you the amplitude of the sine wave and cosine wave at each frequency. Co-incidentally, the first step of a QAM decoder is to split your signal into sine and cosine waves at each frequency. It's this trick that makes OFDM economic to implement; instead of having a QAM decoder for every frequency in the OFDM signal, we perform a Fourier transform on the incoming signal (which we can do efficiently using an algorithm called the FFT), and then all that remains is to quantise each of the amplitudes that comes out, and reconstruct the original digital signal.

From this point, we can do all sorts of tricks; ADSL, for example, uses a different QAM constellation at each frequency to get the maximum data rate out of a single line. DVB-T uses the same QAM constellation in each sub-band, but uses a different subset of the available OFDM carriers for data in each symbol, so narrow band interference doesn't wipe out too much of the wanted data.

Further, because OFDM transforms a high symbol-rate (a symbol is a bit-pattern) wideband signal into a collection of low symbol-rate narrow-band signals, it makes it possible to play tricks that rely on the fact that you can receive at a higher symbol rate than you're actually needing to use; for example, DVB-T can operate in a "single frequency network" mode, where several synchronised transmitters all send the same signal. Because the symbols are relatively slow, and all contain identical data, a receiver can work out what the original digital signal was, and correctly ignore the interfering transmitters.

All in all, OFDM is amazingly simple for what it actually achieves. There are other systems that do similar things (such as CDMA, used in mobile telephones and GPS), but they aren't as simple to explain.

Next on my list of interesting technologies to get the hang of is MIMO, as used in 802.11n wireless networks. This one's even more of a brain-strainer, as it somehow manages to use multiple aerials all tuned to the same frequency to somehow get more data rate than could be done with a single perfect aerial.

2010/07/27

Rant: On asking questions of your engineers

So, this is a pure and simple rant. Feel free to ignore it if you prefer positive thoughts.

When you are asking me a question about something, and you have a definite idea of how you expect me to answer, ask me a specific question that will elicit the answer you want. Don't ask "how well does it perform?" when what you want to know is "how many packets per second can it push?" or "how many videos can it play at once?".

If you can't work out how to phrase the question in a way that makes the type of answer you want obvious, be prepared to have to go back and forth; I'm a software engineer, not a telepath. When I respond to your question with a question of my own, it's because I'm not clear on what you want to know; I'm not trying to shove you away.

Don't get upset when I answer a question with an apparently evasive answer like "well, it's like this if you're thinking of UK Freeview, but like this if you're thinking of New Zealand Freeview, and like this if you're thinking of US cable". I'm not aiming to be deliberately irritating - I want to give you the most accurate answer I can, so that you can avoid accidentally misleading people.

I will lapse into jargon - if you understand it, it's clear as day. If you don't, say so, tell me which bits of jargon are confusing you, and I will try and explain it better. Again, I'm not trying to confuse, I'm trying to help.

When you ask me a question, give me context; don't just ask the question you think you want answered, but include details of why you want it answered. Sometimes, I'll come up with a solution that doesn't need an answer to the question you thought of; sometimes I'll find a way to give you an answer that isn't what you wanted, but that solves your problem perfectly.

Make it clear when you want a detailed answer, and when you want a high level overview; "Can we do this?" is likely to get a "Yes, but there are these problems you need to be aware of when you try and do it" or a "No, but if we did this instead, you'd get a similar result" - I expect you to know enough about why you want to do this to know if my caveats or suggestions are helpful. "I'm filling in a checklist for a bid - can I tick this box?" will get you a "Yes", a "yes, but you have to understand it this way", a "no, but if you pretended they meant this instead you could", or a plain, "no, you can't".

Finally, remember that I'm a person, too, and that means I want to help you if I can - don't cut me off or get annoyed when I offer an answer that isn't what you want; instead, work with me to get yourself an answer that's possible, and that you can live with.

2010/05/25

Thinking rationally about big numbers

One difficulty you see in both politics and everyday life is in comprehending the meaning of numbers; things like "doubling your risk", "as many as 2 million British residents affected", or even "just 50p a day" get thrown around, and you are expected to somehow understand what these numbers mean to you, and whether they should or should not influence your behaviour. I'm not going to look at how these numbers get abused; I recommend Ben Goldacre's Bad Science and Mark Chu-Carroll's Good Math, Bad Math for that.

Instead, I'm going to discuss techniques you can use to help turn overwhelming numbers that you can't get a good grip on into numbers you can understand intuitively. What do I mean by intuitive? In this case, it means that you've got them into the range of numbers that you encounter every day and that you can reason about - this means small fractions (nothing much less than 0.05, or one twentieth), and small numbers (nothing more than a few dozen). It means bringing numbers that refer to big groups down to talking about the group of people you know personally. It means that you've got numbers where your instinctive feel for what a number means actually works properly.

So, let's start with an example; in their manifesto, the BNP claim that there are 300,000 to 500,000 third world immigrants to Britain every year. This is too big a number for me to comprehend instinctively, so my first reaction is to shrink it. The population of the UK is around 60 million, so the BNP's number is less than 1% of the population.

This, however, is still an awkward number to think about; I don't normally think about 1% of a person. So, let's look at this a different way; in a typical week, how many people do you interact with who you'll still recognise a week later (including things like the helpful checkout assistant at the supermarket, whose name you'll never remember, but who you'll recognise by sight)? I reckon there's under 50 of those in a week for me; so, the BNP statistic reduces down to half a person extra in my week who I might recognise in future. Even thinking about the number of people I interact with in a year who I'd still recognise later, I struggle to get to 100 people, which reduces the BNP statistic to "less than one person a year in the size of group I understand".

Once you reduce the scary big number to that, it's not so scary - you can now get into a more meaningful consideration of the number - is an extra person a year in the group you interact with something the country can absorb? Are they being absorbed into the general ebb and flow of British citizenry, or are you seeing Third World ghettos appear in your neighbourhood?

For a different example, imagine newspaper headlines telling you that getting up at 6am and going to bed at 6pm halves your chances of dying from a heart attack before you're 60. It sounds like you should change your habits to match the study; a 50% reduction is huge. However, on further reading, it's not nearly as impressive as it sounds: 94,000 people die of a heart attack in the UK each year, in a population of 60 million, which works out to around 0.16% of the population, or 1 person in every 600, each year. This includes people who die of heart attacks while over 60, which biases the analysis a little, but we'll continue with the known-faulty figure. A useful way to think of this is that in a typical group of (say) 10 people - yourself and your closest friends and family - you'd expect to get through 60 years before one of the group had a heart attack. If you make the group a bit bigger (say 30 people), you now only expect to get through 20 years before someone has a heart attack.

A halving of risk in this case doubles the time to expected heart attack, so our big group now has 40 years between heart attacks, not 20. And, of course, this figure is based on a known-bad assumption; we assumed that under-60s were as likely to have a heart attack as over-60s. However, we know have a more useful way to think about the headline claim - it means that a group of 30 people who follow the advice go from losing a member every 20 years due to heart attacks, to a member every 40 years. Thinking about it this way, you may decide you prefer not to worry about making drastic lifestyle changes.

Two examples, two different sets of reasoning; what's the link? In both cases, I started with a number I couldn't intuitively handle; either too large, or too abstract. I used external statistics to convert it from a raw figure to a probability or proportion I could apply to a group. Finally, I applied the probability to a group that I could picture in my head (all the people I deal with in a week, a group of my closest friends), instead of to an abstract group that I can't really think about. Once I'd done this, I had a number I could reason about rationally, and where my intuition about what it meant matched cold logic, instead of a scary number that I couldn't handle.

2010/05/14

On freeloaders in the benefits system, and reducing the offence they cause

One complaint that appears in the popular press from time to time is that the welfare state is too generous to undeserving people, while not being generous enough to hard-working citizens.

It's an unfortunate reality that no matter how careful you are in designing your welfare state, you're guaranteed one of three outcomes:

  1. Some people freeload and get away with it, because there's nothing in the system to stop them.
  2. Some deserving people don't get the help they need, because the system says no.
  3. The system costs a huge amount to administer, and is much more expensive overall than a system that permits freeloading - you can easily end up spending hundreds of pounds on administration for each pound of freeloading prevented.

I hope that people would agree with me that the third option is absolutely insane - there comes a point where pragmatism says that you shouldn't spend hundreds of pounds just to guarantee that a few pennies don't get given to people who don't need them. This leaves us with just two choices; I would personally prefer that deserving people don't miss out, which means that I have to tolerate freeloaders.

Given this state of affairs, what can be done to ensure that freeloaders don't upset people? First, we need an understanding of why freeloaders upset people; I believe that, in large part, people get upset because they work hard "for what they have", while freeloaders appear to get more by not working at all. We therefore need to ensure that freeloading isn't going to leave you better off than working.

Of course, I have an idea to solve this; simply put, we have plenty of benefits that could easily be paid to everyone, regardless of need, with those who don't need them paying them back in taxes. For example, the highest rate of Jobseeker's Allowance is £65.45 per week per person (around £3,500 per year). The basic rate of income tax is currently 20%, but by removing the personal allowance completely (replacing it with what used to be JSA), you claim back £1,500 from basic rate tax payers; you could then increase the basic rate to claim back the remaining £2,000, or accept that by pushing more people into the higher rate tax band, you're getting more income tax. Further, because people continue to get the same rate of benefits whether they work or not, you encourage people who don't work because they're scared of losing their benefits, or who can't stick out a job for more than a few months at a time to work, and thus pay taxes.

As a second upside, you reduce the amount of administration needed; if you look at all means-tested benefits, and remove those that can fairly be paid to everyone and reclaimed via tax, you reduce the number of people you need to administer the benefits system. There will still be exceptional cases (disability benefits for one), but they're fewer and further between.

There are, of course, downsides. For one, you need to be good at catching out tax dodgers; if people hide from the tax system in the black market, the maths stops working out. You still have a social problem; while you're now always better off working for a living, people will still resent carrying people who don't work, even though they should. I do, however, believe that this system will lead to less resentment, and even, possibly, more employment overall (it becomes possible to work for a couple of hours a week, without losing out on your "bennies").

2010/05/01

A proposal for Parliamentary reform in the UK

Anyone in the UK will be aware that we've got a general election coming up, and thus that our parliament is suspended until after the election; one of the many things we were promised that hasn't materialised is full reform of the upper chamber (the House of Lords). This, then, is my modest proposal for reforming Parliament to better reflect the modern UK.

First, a brief look at what we have now. Parliament is split into two houses; Commons, the elected MPs, and Lords, who are appointed for life (in theory by the monarch, in practice by the Commons). New legislation can be proposed in either house; it's debated and amended by the house in which it was proposed. Once it's approved, it's sent to the other house, where the process is repeated by a different group of people; eventually, both houses approve the legislation without amendment, and it becomes law.

There is a tie-break process in place (the Parliament Act) to ensure that the Lords cannot completely block legislation. If the Commons can agree to a proposed bill three times without amending it themselves or accepting amendments from the Lords, the Lords are not given the chance to reject or amend the legislation again.

By and large, this setup works. The Lords act to balance the Commons' short-term thinking, but cannot hold back a Commons that is determined to pass a particular piece of legislation. The back and forth process between the two houses ensures that most legislation gets discussed properly, and that it's possible for Commons MPs (who are under pressure from voters) to say "we tried to get your knee-jerk legislation in place, but it got watered down by the Lords".

There are, however, two issues that I see with it:

  1. The Lords is often reactionary and disconnected from the populace; this leads to media discontent with the Lords. I'm not entirely sure that this is an issue worth solving, as it's more about perception than reality.
  2. By and large, the flow of legislation is entirely one way; the statute book grows, but does not normally shrink. Ignorance of the law is no defence in English law, so as time goes on, it becomes harder to remain a law-abiding citizen.

Naturally, I have proposals for fixing both of these; I will start with the second, as I see this as a bigger issue.

Firstly, we need to think about why the statute book keeps growing; there are many causes for this:

  • Statute starts to cover more and more things that were previously not a problem. For example, there are no 17th century laws regulating driving on the motorway, or mobile telephony.
  • Statutes get introduced to cover things that are a concern at the time, but which are no longer relevant; for example, we still have statute covering the militias, which have long been replaced by the modern Army.
  • Statutes are introduced to cover a very specific problem; after a while, we work out that the specific problem is just one example of a more general problem, we legislate to cover the more general problem, but the specific legislation remains.
  • Statute covers something that, at the time of introduction, is believed to be a problem. As time goes by, and society adjusts, we stop enforcing statute, as we discover that there is no problem; however, the statute remains, and can be suddenly enforced at any time. Enforcement of the statute will surprise people.

It's clear that some of this can't be avoided - we need new legislation to handle problem that never existed before, and it's not surprising that general legislation overtakes specific legislation as the true scope of a problem becomes clear. However, some of it is simple waste; once we have the general legislation, we don't need the specific legislation. We don't need legislation that refers to a time gone by, and that's now irrelevant. We should lose legislation that's no longer enforced.

So, on to my modest proposal to fix this: all legislation should have a built-in expiry date. If it's not renewed by the expiry date, it comes off the statute books, and, if it's still needed, it must be reintroduced. In order to stop important legislation falling off the books, I would put a duty on the Lords to review all legislation that's approaching expiry.

Obviously, there are details to work out; what expiry date should be put on legislation? If it's too short, the Lords wastes time renewing legislation again and again; if it's too long, it doesn't keep the statute book clear. I would suggest that the ideal unit of time is the lifetime of a parliament (typically 5 years, although it can be shorter). By making the expiry the end of a parliament, we give the Lords time to renew legislation before it expires. In order to keep statute changes flowing through, I would suggest setting the expiry based on the vote that passed the legislation, according to the table below:

Size of majority in CommonsSize of majority in LordsExpiry of legislation
50% or more of the MPs who voted50% or more of the MPs who votedEnd of the next parliament (circa 5 years)
75% or more of the MPs who voted, and at least 50% of all MPs voting50% or more of the MPs who votedEnd of the parliament after next (circa 10 years)
50% or more of the MPs who voted75% or more of the MPs who voted, and at least 50% of all MPs votingEnd of the parliament after next (circa 10 years)
75% or more of the MPs who voted, and at least 50% of all MPs voting75% or more of the MPs who voted, and at least 50% of all MPs votingEnd of the 4th parliament after this one (circa 20 years)

This ensures that legislation which MPs can be persuaded to care about lasts longer than legislation that doesn't particularly appeal to their sense of duty; for example, murder laws would almost certainly get renewed for close to 20 years at a time, as would a new bill protecting people from unlawful killing, while "special interest" legislation is unlikely to last much more than 5 years at a time.

The renewal process would work much like the process for introducing new legislation; someone brings the bill for renewal before the house, it's debated, voted on, and eventually, passes; the size of majority affects when it next comes up for renewal, just like new legislation.

I would expect this to gradually reduce the size of the statute book; because many laws are non-controversial (and thus will get renewed without question), it reduces the time available to produce new laws. Laws that should be repealed will face fresh scrutiny on a regular basis, and, with any luck, the resulting reduction in rate of change of legislation will enable any citizen of the UK to memorise all the statutes that affect them.

So, onto the less important reform; making the Lords democratically accountable. There are 646 seats in the House of Commons. I would make the Lords the same size as the Commons, but, instead of electing each seat using first past the post, I would group Commons seats into 38 groups, each of which returns 16 members to the Lords. These members would be elected by the constituents of the 17 seats they represent using single transferable vote; a system in which electors mark their preferences in order, and which aims to elect the least objectionable of the candidates. Elected members survive 4 parliaments, and each constituency would be expected to elect in groups of 4 at a time at the same time as they elect their Commons MP.

This results in members of the Lords being able to take a much more long-term view than Commons MPs; they can expect to be in office for 20 years at a time, to the 5 years of a Commons MP. It also reduces the turnover, resulting in a lot of continuity in the Lords. STV also tends to prevent tactical voting - you can afford to put the virtually unelectable candidate you agree with before the very electable candidate you just about could live with, knowing that if you're right, and they don't get elected, your vote still helps prevent the candidate you couldn't live with from winning.

This leaves 38 seats empty, as against the Commons. I would increase this by 2, to get 2 more Lords than Commons. Again, these 40 would survive 4 parliaments at a time, and again, I would replace in groups of 5, so that there's a slow turnover. However, these 40 would be appointed by the incoming Commons administration; their role is to ensure that there are people in the Lords who can act as a link between the administration, including past administrations whose laws are up for renewal, and the Lords, to explain the rationale behind Government bills in Lords debate.

As you may have gathered from this ramble, I do have an interest in politics. I would be interested to hear other people's views on reforming UK politics - including explanations of why it's not needed.

2010/03/27

How a 1980s telecoms compromise helped set the Bluray video format.

I've mentioned the ATM committee's weird decisions before, when talking about ADSL; this post is meant to make you think about how seemingly small committee decisions can have long term impact.

To recap; in the 1980s, telecoms engineers were setting standards for "fast" data links (45MBit/s and above), to be used to carry voice, fax and data; the decision was made to use small cells, so that even slow links could use the same standard. The resulting standard, ATM, has a 48 byte payload and a 5 byte header on every cell.

There's only one standard set worth considering if you're interested in serious video; the MPEG standards. Both DVD and Bluray are built on MPEG; DVD uses MPEG-2 exclusively, carrying video and audio in an MPEG-2 program stream, extended to add timecode to packets, resulting in the "VOB" file format. This has limitations when it comes to seeking; when an optical disk player seeks, it moves the read head to a location that's approximately right, then reads the disk until it finds the timecode it's after, then either moves the heads again (to a better estimate of the correct place), or resumes playback. Because program stream packets are variable-length, the player can end up reading a significant amount of data, only to discover that the timecode tells it that it's badly off, and it has to seek again.

Bluray escapes this by using MPEG-2 transport streams as the container, but with a 4-byte timecode added to each transport packet. Transport stream packets are fixed in length at 188 bytes, so a Bluray player never needs read more than 192 bytes after seeking before it can decide whether it needs to seek again to a better guess at the correct location, or whether it can just read to the right point.

188 bytes is a rather unusual number; the header is 4 bytes long, and the payload length of 184 bytes is neither a nice number for humans, nor is it a nice number for computers to deal with. So, why did the MPEG-2 committee choose 188 bytes for transport stream packet size? It all comes back round to ATM; when MPEG-2 was being designed, ATM was the telecommunications networking technology of choice, and it was considered important that you should be able to easily carry MPEG-2 transport packets in ATM.

There are two sensible ATM Adaptation Layers for MPEG-2; AAL1, meant for constant bit rate services (such as carrying a multiplex from BBC headquarters to the Freeview transmission sites around the country), and AAL5, for services that can cope with a long delay. AAL1 takes 1 byte from every cell's payload, leaving 47 bytes for the user; 47 times 4 is 188, which is where MPEG-2 gets 188 bytes from. It also works well for AAL5; AAL5 uses 8 bytes from every group of up to 1366 cells, leaving 40 bytes in that cell and 48 bytes in the remaining cells in the group for user data; two 188 byte packets plus 8 bytes of AAL5 overhead fit precisely in 8 cells with no padding.

So, to interoperate well with ATM, the MPEG-2 guys chose 188 bytes for their fixed-packet-length container. MPEG has been wildly successful, so that the Bluray guys didn't want to design their own container format. As a result, a compromise between France (who wanted 32 bytes payload), and the USA (who wanted 64 bytes payload) has influenced the design of the most modern consumer video format to date. Next time you're compromising on a technical issue, think hard; your compromise may live on longer than you expected, and affect more people than you thought it would.