The Hitchhiker's Guide to Encoding: Life, Encoders and Everything (Or a brief history of HD encoding)
MondayThere has been a lot of discussion, speculation, rumour and some complaints about picture quality in blogs and posts ever since the BBC HD Channel trial started in 2006. When we started, real-time H264 coding was quite new and the early versions of encoders were not that much more efficient than the existing MPEG2 HD encoders.
EBU - TECH 3328 Current Status of High Definition Television Delivery Technology (May 2008)
... EBU investigations in 2005 showed that some MPEG-4 H.264/AVC hardware encoders did not show any bitrate advantage over MPEG-2 and in some cases even performed less well than MPEG-2 encoders. This situation improved by September 2006, and continued to improve in 2007 and 2008.
The original encoders ran at around 19Mbs and struggled to maintain the quality we wanted for a mixed genre channel.
Early in 2007 tests began on the new firmware. This was a substantial upgrade, introducing new software tools that helped the encoder cope with the wider range of programmes and programme styles the channel now had. It also allowed us to reduce the bit rate to 16Mbs with no noticeable loss of quality. The new version went live just before Wimbledon 2007 giving us an ideal opportunity to compare the image quality with the previous year's tournament. Direct comparisons between the 2006 and 2007 tournaments were very encouraging especially when matches went on late into the evening and camera gain (and therefore camera noise level) was higher than I would really like to see.
After the change I did a couple of blogs about TV set-up and about the different programme styles we were transmitting, particularly about the use of film motion (25p) and shallow depth of field (I will talk more about programme styles in a future post):
There were some complaints about the new bit rates and a few centred on the Angel Falls sequence from the Planet Earth series. This was a great sequence and it was no surprise it was one of the first to be used in the "Great Moments" promotions the channel still shows. The Great Moments promotions started after the change to 16Mbs whereas the programme was first shown with the original encoder settings shortly after the trial started.
The Angel Falls sequence was an early use of the helicopter set-up that gave the series such iconic shots but after seeing the rushes we were worried about what looked like interference on the tapes.
When the sequence first went out, the original encoder and software didn't resolve the noise but when the clip was used later, the noise was clearly visible.
Above: The Angel Fall sequence from Plant Earth from the programme tape.
Left: This is a blow up of the rocks in the picture above. The horizontal lines are noise on the original tape.
This leads me on to taking screen grabs or capturing still frames from the channel's transmission signal. It has been fascinating to see some of the stills grabbed off air. Still frames are an interesting analysis tool for picture quality and for making comparisons but they do have to be completely identical and the stills format used must either be uncompressed or the native file format of the coded frame to eliminate additional artefacts as a result of concatenation with the stills format itself.
This is an old, but useful article if you want to read more about concatenation and digital broadcasting:
Getting identical stills from an MPEG signal to use for quality comparison is not straight forward. Ideally the image should be the same to make comparisons easier but it is more important that the frame type matches. Typically MPEG 4 encodes frames as one of three types; I-Frames, P-Frames or B-Frames.
I-Frames are coded in isolation without reference to any other frame.
P- Frames (Predicted frames) are made up from the differences between the current frame and previous I or P frames, known as "reference" frames.
B-Frames (Bidirectional-predicted frames) are made up from differences between the current frame and preceding and following reference frames. Unlike MPEG2, reference frames for B-frames can be I, P or even B-frames themselves.
A group of pictures may be made from a sequence of I, P and B frames starting with an I-Frame e.g. IBBPBBPBBPBB - IBBPBBPBBPBB etc. The exact order can be adapted to take account of shot changes and motion within a sequence. This grouping of frames is known colloquially as a GOP structure (Group of Pictures) - imaginative aren't we!
Although still frames are a useful tool for picture analysis, quality comparison using stills is best done with reference to the original source and using the appropriate I-Frames.
Looking through the stills that have been posted it has been really interesting to see quality of some of them, including the odd one or two that suggested the new encoder is better!
Tomorrow is a chance to look at some of the EBU documents on HD and the BBC's involvement with EBU Recommendations.
Andy Quested is Principal Technologist, HD, BBC Future Media and Technology.
Read part 1 of Andy Quested's HD guide: The Hitchhiker's Guide to Encoding: Before we start